From 4a4b5e05576c68b382e5a6b19638da785cc81c45 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 24 May 2015 22:09:13 +0200 Subject: Using email as id; User & PasswordReminder --- src/controllers/PasswordReminderController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/controllers/PasswordReminderController.php') diff --git a/src/controllers/PasswordReminderController.php b/src/controllers/PasswordReminderController.php index b3fd8da..ed3592e 100644 --- a/src/controllers/PasswordReminderController.php +++ b/src/controllers/PasswordReminderController.php @@ -31,7 +31,7 @@ class PasswordReminderController extends BaseController { public function store($userId) { $user = User::findOrFail($userId); - $this->passwordReminder->userId = $user->id; + $this->passwordReminder->userEmail = $user->email; $this->passwordReminder->token = bin2hex(openssl_random_pseudo_bytes(24)); if ($this->passwordReminder->save()) { @@ -43,13 +43,16 @@ class PasswordReminderController extends BaseController { /** * Destroy the password reminder means setting a new password for the user - * @param Request $request - * @param $userId + * @param $userEmail + * @param $reminderToken + * @return null */ - public function destroy($userId, $reminderToken) { + public function destroy($userEmail, $reminderToken) { $user = Auth::user(); $user->password = Request::get('password'); $user->save(); + $this->passwordReminder = $this->passwordReminder->findOrFail($reminderToken); + $this->passwordReminder->useToken(); return null; } -- cgit v1.2.3