Completed reset password section and added in eye button to toggle between shown and hidden password.

Signed-off-by: rodude123 <rodude123@gmail.com>
This commit is contained in:
2022-09-14 13:35:58 +01:00
parent d8e16e8de1
commit d963904174
14 changed files with 191 additions and 42 deletions
+15
View File
@@ -81,4 +81,19 @@ class user
mail($email, "Reset Password Verification Code", $message, $headers1);
return $token;
}
function changePassword($email, $password): bool
{
$conn = dbConn();
$stmt = $conn->prepare("UPDATE users SET password = :password WHERE email = :email");
$newPwd = password_hash($password, PASSWORD_BCRYPT);
$stmt->bindParam(":password", $newPwd);
$stmt->bindParam(":email", $email);
if ($stmt->execute())
{
return true;
}
return false;
}
}