Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
shugineign committed Apr 28, 2021
1 parent 5627392 commit d60671d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,17 @@ public function exchange()
}

$state = $this->getState();
if (! $state || ! $this->transientHandler->verify(self::TRANSIENT_STATE_KEY, $state)) {

$stateless = session('upbond_auth__stateless');

if (!$stateless &&
(! $state || ! $this->transientHandler->verify(self::TRANSIENT_STATE_KEY, $state))
) {
throw new CoreException('Invalid state');
}

session(['upbond_auth__stateless' => false]);

if ($this->user) {
throw new CoreException('Can\'t initialize a new session while there is one active session already');
}
Expand Down

0 comments on commit d60671d

Please sign in to comment.