Skip to content

Commit 6795c36

Browse files
committed
refactor: ♻️ Renamed property send_nonce to enable_nonce
1 parent 1f25f72 commit 6795c36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Client.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Client
5656
private string $code_challenge_method;
5757
private array $pkce_algorithms = ['S256' => 'sha256', 'plain' => false];
5858
private bool $enable_pkce;
59-
private bool $send_nonce;
59+
private bool $enable_nonce;
6060

6161
private PendingRequest $http_client;
6262

@@ -88,7 +88,7 @@ public function __construct(#[ArrayShape([
8888
'verify' => '?bool',
8989
'scopes' => '?array',
9090
'enable_pkce' => '?bool',
91-
'send_nonce' => '?bool',
91+
'enable_nonce' => '?bool',
9292
'allow_implicit_flow' => '?bool',
9393
'code_challenge_method' => '?string',
9494
'timeout' => '?int',
@@ -136,7 +136,7 @@ public function __construct(#[ArrayShape([
136136
'issuer' => $provider_url,
137137
'scopes' => [],
138138
'enable_pkce' => true,
139-
'send_nonce' => true,
139+
'enable_nonce' => true,
140140
'allow_implicit_flow' => false,
141141
'code_challenge_method' => 'plain',
142142
'leeway' => 300,
@@ -256,7 +256,7 @@ public function authenticate(): bool
256256
// Save the id token
257257
$this->id_token = $id_token;
258258

259-
if ($this->send_nonce && $request->get('nonce') === Session::get('oidc_nonce')) {
259+
if ($this->enable_nonce && $request->get('nonce') === Session::get('oidc_nonce')) {
260260
return true;
261261
}
262262
Session::remove('oidc_nonce');
@@ -317,7 +317,7 @@ public function getAuthorizationUrl(?array $query_params=null): string
317317
'scope' => implode(' ', array_merge($this->scopes, ['openid']))
318318
])->merge($query_params);
319319

320-
if ($this->send_nonce) {
320+
if ($this->enable_nonce) {
321321
$nonce = Str::random();
322322
Session::set('oidc_nonce', $nonce);
323323
$params->put('nonce', $nonce);

0 commit comments

Comments
 (0)