Skip to content

Commit

Permalink
fix: link fails due to forgetting before reading
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland authored Nov 15, 2023
1 parent 3c74c8f commit 21b9e3b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Controllers/AbstractOAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,8 @@ protected function handleOAuthResponse(ServerRequestInterface $request, AccessTo
// Don't register a new user, just link to the existing account, else continue with registration.
if ($sessionLinkToExists && $actor->exists) {
$actor->assertRegistered();
// forget the linkTo key
$this->forget(self::SESSION_LINKTO, $session);

$sessionLink = (int) $this->get(self::SESSION_LINKTO, $session);
$this->forget(self::SESSION_LINKTO, $session);

if ($actor->id !== $sessionLink || $sessionLink === 0) {
throw new ValidationException(['linkAccount' => 'User data mismatch']);
Expand Down

0 comments on commit 21b9e3b

Please sign in to comment.