Skip to content

Commit d5a77aa

Browse files
committed
Update callback controller to avoid clearing of token cache
1 parent dca4548 commit d5a77aa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Controllers/CallbackControllerAbstract.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function __invoke(
7474

7575
event(new Failed($guard::class, $guard->user(), $credentials));
7676

77-
$this->clearSession($guard, true, true, true);
77+
$this->clearSession($guard);
7878

7979
// Throw hookable $event to allow custom error handling scenarios.
8080
$event = new AuthenticationFailed($throwable, true);
@@ -101,7 +101,7 @@ public function __invoke(
101101
'error' => ['error' => $error, 'description' => $errorDescription],
102102
]));
103103

104-
$this->clearSession($guard, true, true, true);
104+
$this->clearSession($guard);
105105

106106
// Create a dynamic exception to report the API error response
107107
$exception = new CallbackControllerException(sprintf(CallbackControllerException::MSG_API_RESPONSE, $error, $errorDescription));
@@ -137,6 +137,7 @@ public function __invoke(
137137
*/
138138
$guard->login($credential, Guard::SOURCE_SESSION);
139139

140+
$request->session()->invalidate();
140141
$request->session()->regenerate();
141142

142143
$event = new AuthenticationSucceeded($user);
@@ -157,7 +158,7 @@ private function clearSession(
157158
GuardAbstract $guard,
158159
bool $clearTransientStorage = true,
159160
bool $clearPersistentStorage = true,
160-
bool $clearSdkStorage = false,
161+
bool $clearSdkStorage = true,
161162
): void {
162163
$service = $guard->service() ?? null;
163164

0 commit comments

Comments
 (0)