From 497549300ce8231f5b25c93a4f95aeb35baad027 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 13 May 2015 13:43:16 +0200 Subject: Password reminders start --- src/controllers/PasswordReminderController.php | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/controllers/PasswordReminderController.php (limited to 'src/controllers') diff --git a/src/controllers/PasswordReminderController.php b/src/controllers/PasswordReminderController.php new file mode 100644 index 0000000..0c2a087 --- /dev/null +++ b/src/controllers/PasswordReminderController.php @@ -0,0 +1,35 @@ +passwordReminder = $passwordReminder; + } + + /** + * Set the userId and create a random token + */ + public function store() { + $this->passwordReminder->userId = Input::get('user_id'); + $this->passwordReminder->token = base64_encode(openssl_random_pseudo_bytes(64)); + + if ($this->passwordReminder->save()) { + return $this->passwordReminder; + } else { + throw new \Dingo\Api\Exception\StoreResourceFailedException; + } + } + +} \ No newline at end of file -- cgit v1.2.3