Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/Authentication/Authenticators/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ public function getAction(): ?ActionInterface
*/
public function checkAction(UserIdentity $identity, string $token): bool
{
$user = ($this->loggedIn() || $this->isPending()) ? $this->user : null;

if ($user === null) {
if (! $this->loggedIn() && ! $this->isPending()) {
throw new LogicException('Cannot get the User.');
}

Expand All @@ -246,15 +244,13 @@ public function checkAction(UserIdentity $identity, string $token): bool
}

// On success - remove the identity
$this->userIdentityModel->deleteIdentitiesByType($user, $identity->type);
$this->userIdentityModel->deleteIdentitiesByType($this->user, $identity->type);

// Clean up our session
$this->removeSessionUserKey('auth_action');
$this->removeSessionUserKey('auth_action_message');

$this->user = $user;

$this->completeLogin($user);
$this->completeLogin($this->user);

return true;
}
Expand Down
Loading