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. |
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.');
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How can I ensure that a reset password is different than a current password? Here is my current controller:
All reactions