在Laravel 5.5中更新用户密码后阻止注销

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!