Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Add remember session option #44

Merged
merged 4 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/socialstream.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@

'show' => env('SHOW_SOCIALSTREAM', true),

/*
|--------------------------------------------------------------------------
| Socialstream Remember Session
|--------------------------------------------------------------------------
|
| This value is used to determine if a session created by socialstream
| uses the "remember me" login parameter.
|
*/

'remember' => env('SOCIALSTREAM_REMEMBER', false),

/*
|--------------------------------------------------------------------------
| Socialstream Route Middleware
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function handleProviderCallback(Request $request, string $provider)

$user = $this->createsUser->create($provider, $providerAccount);

$this->guard->login($user);
$this->guard->login($user, config('socialstream.remember'));

return redirect(config('fortify.home'));
}
Expand All @@ -157,7 +157,7 @@ public function handleProviderCallback(Request $request, string $provider)
);
}

$this->guard->login($account->user);
$this->guard->login($account->user, config('socialstream.remember'));

$account->user->forceFill([
'current_connected_account_id' => $account->id,
Expand Down