Skip to content

Commit 11ee3e9

Browse files
authored
feat: Allow custom state
1 parent 4d16b7b commit 11ee3e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ public function signOut(string $id_token, ?string $redirect=null): void
312312
*
313313
* @throws Exception
314314
*/
315-
public function getAuthorizationUrl(?array $query_params=null): string
315+
public function getAuthorizationUrl(?array $query_params=null, ?string $state=null): string
316316
{
317317
$auth_endpoint = $this->authorization_endpoint;
318318

319319
// State essentially acts as a session key for OIDC
320-
$state = Str::random();
320+
$state = $state ?? Str::random();
321321
Session::set('oidc_state', $state);
322322

323323
$params = collect([

0 commit comments

Comments
 (0)