Beginning with Laravel 5.3, this middleware was added...
\Illuminate\Session\Middleware\AuthenticateSession
While it's definitely a benefit for security purposes, it's also responsible for logging the user out (presenting the user with the login page) if they change their password.
How do we prevent a user from being logged out (being forced to log back in) when they change their password, in Laravel 5.5?
Instead of changing the middleware, just "re-login" the user after changing the password:
<?php
//$user->passwordChangeMagicHere()
Auth::login($user);
//And the user is logged in again!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With