mirror of
https://github.com/flarum/core.git
synced 2025-07-26 03:01:22 +02:00
Prevent crash if logged in user has been deleted
This commit is contained in:
@@ -55,7 +55,8 @@ class AuthenticateWithCookie implements MiddlewareInterface
|
|||||||
if ($token = $this->getToken($request)) {
|
if ($token = $this->getToken($request)) {
|
||||||
if (! $token->isValid()) {
|
if (! $token->isValid()) {
|
||||||
// TODO: https://github.com/flarum/core/issues/253
|
// TODO: https://github.com/flarum/core/issues/253
|
||||||
} elseif ($actor = $token->user) {
|
} elseif ($token->user) {
|
||||||
|
$actor = $token->user;
|
||||||
$actor->updateLastSeen()->save();
|
$actor->updateLastSeen()->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user