aboutsummaryrefslogtreecommitdiff
path: root/src/controllers/PasswordReminderController.php
diff options
context:
space:
mode:
authorCamil Staps2015-05-24 22:09:13 +0200
committerCamil Staps2015-05-24 22:09:13 +0200
commit4a4b5e05576c68b382e5a6b19638da785cc81c45 (patch)
tree334a651073eea8672ddc93a96e5b9372c48c01f6 /src/controllers/PasswordReminderController.php
parentPassword reminders (diff)
Using email as id; User & PasswordReminder
Diffstat (limited to 'src/controllers/PasswordReminderController.php')
-rw-r--r--src/controllers/PasswordReminderController.php11
1 files changed, 7 insertions, 4 deletions
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;
}