Replies: 2 comments
-
Probably the easiest way would be to use PHP's password_verify to compare the password they want to change it to against the existing password hash. This would have to be done prior to updating the user's password, obviously. If you want to get really clean you could turn it into a custom validation rule. |
Beta Was this translation helpful? Give feedback.
0 replies
-
try: $result = auth()->check([
'email' => auth()->user()->email,
'password' => $this->request->getPost('password'),
]);
if ($result->isOK()) {
return redirect()->to('anyroute')->withInput()->with('error', 'Your current password is the same as the chosen password.');
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can I ensure that a reset password is different than a current password? Here is my current controller:
Beta Was this translation helpful? Give feedback.
All reactions