Answer the question
In order to leave comments, you need to log in
How to log out a user after their password has been changed?
Hello, tell me please. I am now implementing the possibility that the administrator could change the user's password. When the administrator changed the user's password, it is necessary that the user be thrown out of the system, and then he re-logged in with a new password.
To do this, I added the logout field in the users table, by default this field is false, but when the user's password has changed, it is true. And in Middleware Authenticate.php I do the following check:
$user = Auth::user();
if($user) {
if($user->logout) {
$user->logout = false;
$user->save();
Auth::logout();
return redirect('/');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question