mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:11:40 +08:00
Clean up
This commit is contained in:
parent
79ec0ef0ec
commit
6443f5d95c
@ -54,8 +54,6 @@ trait AuthenticateUserTrait
|
||||
// unique token for these attributes and add it to the response, along
|
||||
// with the suggested account information.
|
||||
if ($user) {
|
||||
$accessToken = $this->bus->dispatch(new GenerateAccessToken($user->id));
|
||||
|
||||
$payload = ['authenticated' => true];
|
||||
} else {
|
||||
$token = AuthToken::generate($identification);
|
||||
@ -64,16 +62,17 @@ trait AuthenticateUserTrait
|
||||
$payload = array_merge($identification, $suggestions, ['token' => $token->id]);
|
||||
}
|
||||
|
||||
$content = sprintf('<script>
|
||||
window.opener.app.authenticationComplete(%s);
|
||||
window.close();
|
||||
</script>', json_encode($payload));
|
||||
$content = sprintf(
|
||||
'<script>window.opener.app.authenticationComplete(%s); window.close();</script>',
|
||||
json_encode($payload)
|
||||
);
|
||||
|
||||
$response = new HtmlResponse($content);
|
||||
|
||||
if (isset($accessToken)) {
|
||||
if ($user) {
|
||||
// Extend the token's expiry to 2 weeks so that we can set a
|
||||
// remember cookie
|
||||
$accessToken = $this->bus->dispatch(new GenerateAccessToken($user->id));
|
||||
$accessToken::unguard();
|
||||
$accessToken->update(['expires_at' => new DateTime('+2 weeks')]);
|
||||
|
||||
|
2
framework/core/stubs/extension/.gitignore
vendored
2
framework/core/stubs/extension/.gitignore
vendored
@ -2,3 +2,5 @@
|
||||
composer.phar
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
node_modules
|
||||
bower_components
|
3
framework/core/stubs/extension/js/.gitignore
vendored
3
framework/core/stubs/extension/js/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
bower_components
|
||||
node_modules
|
||||
dist
|
Loading…
x
Reference in New Issue
Block a user