Update lastSeenAt when authenticating via API (#3058)

Fixes https://github.com/flarum/core/issues/3025, title says it all.
This commit is contained in:
Alexander Skvortsov 2021-08-27 14:02:03 -04:00 committed by GitHub
parent 80b804b297
commit ca77747463

View File

@ -47,6 +47,8 @@ class AuthenticateWithHeader implements Middleware
} }
if (isset($actor)) { if (isset($actor)) {
$actor->updateLastSeen()->save();
$request = RequestUtil::withActor($request, $actor); $request = RequestUtil::withActor($request, $actor);
$request = $request->withAttribute('bypassCsrfToken', true); $request = $request->withAttribute('bypassCsrfToken', true);
$request = $request->withoutAttribute('session'); $request = $request->withoutAttribute('session');