Skip to content

Commit ec4e3ac

Browse files
Nebualevansims
andauthored
Auth0->exchange(): optimize redundant setcookie() calls (#591)
Co-authored-by: Evan Sims <[email protected]>
1 parent 8c4aba4 commit ec4e3ac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Auth0.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,14 @@ public function exchange(
309309
$codeVerifier = null;
310310
$user = null;
311311

312+
$this->clear(false);
312313
$this->deferStateSaving();
313314

314315
if ($code === null) {
315316
$this->clear();
316317
throw \Auth0\SDK\Exception\StateException::missingCode();
317318
}
318319

319-
$this->clear(false);
320-
321320
if ($state === null || ! $this->getTransientStore()->verify('state', $state)) {
322321
$this->clear();
323322
throw \Auth0\SDK\Exception\StateException::invalidState();

0 commit comments

Comments
 (0)