Skip to content

Commit e2fe565

Browse files
committed
Allow remember functionality via query string
1 parent 6c730f8 commit e2fe565

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ Now when users visit `/auth/powerschool/oidc` in your application, the OAuth flo
282282
<!-- <a href="/auth/powerschool/oidc?persona=teacher">Teacher sign in</a> -->
283283
```
284284
285-
The above link will tell PowerSchool that a parent is authenticating, so it can take them directly to the /public login page.
285+
The above link will tell PowerSchool that a parent is authenticating, so it can take them directly to the /public login page. You can also allow for longer authenticated sessions by adding a `remember` query variable with a truthy value, such as `1` or `true`. By default, it is `false`. For example:
286+
287+
```html
288+
<a href="/auth/powerschool/oidc?remember=1">Sign in with PowerSchool</a>
289+
```
286290
287291
Just like the OpenID 2.0 "hook" functionality, the OIDC trait has the same ability to modify user attributes and other behavior.
288292

src/Traits/AuthenticatesUsingPowerSchoolWithOidc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function getRedirectToRoute(string $userType): string
6969
*/
7070
protected function remember(): bool
7171
{
72-
return false;
72+
return !!session()->pull('ps_oidc_remember', false);
7373
}
7474

7575
/**
@@ -95,6 +95,7 @@ public function authenticate(Request $request)
9595
$configuration = $this->getOidcConfiguration();
9696
$nonce = Str::random();
9797
session()->put('ps_oidc_nonce', $nonce);
98+
session()->put('ps_oidc_remember', $request->boolean('remember'));
9899

99100
$url = Url::fromString($configuration['authorization_endpoint'])
100101
->withQueryParameter('response_type', 'code')

0 commit comments

Comments
 (0)