1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 07:24:27 +02:00

Add external authenticator (social login) API

Allows registrations to be completed with a pre-confirmed email address
and no password.
This commit is contained in:
Toby Zerner
2015-09-15 11:27:31 +09:30
parent 53f7112248
commit 6beb4fe898
27 changed files with 516 additions and 96 deletions

View File

@@ -50,7 +50,7 @@ class LoginWithHeader implements MiddlewareInterface
if (isset($parts[0]) && starts_with($parts[0], $this->prefix)) {
$token = substr($parts[0], strlen($this->prefix));
if ($accessToken = AccessToken::valid($token)) {
if (($accessToken = AccessToken::find($token)) && $accessToken->isValid()) {
$this->app->instance('flarum.actor', $user = $accessToken->user);
$user->updateLastSeen()->save();