diff --git a/functions/panel/user.php b/functions/panel/user.php index 5795dbc..e630f13 100644 --- a/functions/panel/user.php +++ b/functions/panel/user.php @@ -19,6 +19,7 @@ public static function startResetPassword($email) { } $resetkey = Utilities::generate_string(64); self::$database->prepare("UPDATE passwordreset SET resetkey = ? WHERE email = ?")->execute(array($resetkey, $email)); + return $resetkey; } public static function submitPasswordReset($email, $key) { diff --git a/routes/auth/index.php b/routes/auth/index.php index dadf30c..bfe57f9 100644 --- a/routes/auth/index.php +++ b/routes/auth/index.php @@ -71,7 +71,7 @@ $response->redirect("/auth/register", 302); return; } - $result = User::create($request->param('email'), $request->param('email'), $request->param('password')); + $result = User::create($request->param('email'), $request->param('username'), $request->param('password')); if (!$result['success']) { $service->flash($result['error']); } else { @@ -115,6 +115,7 @@ if ($resetKey == null) { $service->flash('Your reset link has been emailed to you'); $response->redirect('/auth/login', 302); + return; } $url = Config::getGlobal('site')['full'] . '/auth/resetpw?email=' . $request->param('email') . '&resetkey=' . $resetKey; Email::send($request->param('email'), 'Password reset for cp.ae97.net', 'Someone requested your password to be reset. If you wanted to do this, please use this link to '