From 5bac29065d4be00d69705954675b096909dcfde3 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 4 Dec 2016 16:44:50 +0100 Subject: [PATCH] Improve documentation --- src/Auth.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Auth.php b/src/Auth.php index 86e4286..f663df3 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -231,7 +231,9 @@ class Auth { $selector = self::createRandomString(16); $token = self::createRandomString(16); $tokenHashed = password_hash($token, PASSWORD_DEFAULT); - $expires = time() + 3600 * 24; + + // the request shall be valid for one day + $expires = time() + 60 * 60 * 24; try { $this->db->insert( @@ -622,6 +624,7 @@ class Auth { if (!empty($passwordInDatabase)) { if (password_verify($oldPassword, $passwordInDatabase)) { + // update the password in the database $this->updatePassword($userId, $newPassword); } else { @@ -842,6 +845,7 @@ class Auth { if ($resetData['expires'] >= time()) { $newPassword = self::validatePassword($newPassword); + // update the password in the database $this->updatePassword($resetData['user'], $newPassword); try {