Laravel's guard keeps a $user instance cached so that multiple requests to Auth::user() don't hit the database each time. This means that we won't see any changes made to that user record until the following page load, however, unless we tell the user provider about it!
What's this PR do?
Laravel's guard keeps a
$user
instance cached so that multiple requests toAuth::user()
don't hit the database each time. This means that we won't see any changes made to that user record until the following page load, however, unless we tell the user provider about it!This pull request updates that cached user with
Auth::setUser
so that if we update a user's access token via the "refresh token" middleware, we'll get that new one on future calls toAuth::user()
.How should this be reviewed?
I'll put up a PR to update Phoenix's dependencies after this is merged!
Checklist