mirror of
https://github.com/flarum/core.git
synced 2025-10-12 07:24:27 +02:00
Make sure access/email/password tokens are valid
This commit is contained in:
@@ -34,7 +34,7 @@ class LoginWithHeader implements MiddlewareInterface
|
||||
$header = $request->getHeaderLine('authorization');
|
||||
if (starts_with($header, $this->prefix) &&
|
||||
($token = substr($header, strlen($this->prefix))) &&
|
||||
($accessToken = AccessToken::where('id', $token)->first())
|
||||
($accessToken = AccessToken::valid($token))
|
||||
) {
|
||||
$this->app->instance('flarum.actor', $user = $accessToken->user);
|
||||
|
||||
|
Reference in New Issue
Block a user