Skip to content

Conversation

@thekid
Copy link
Member

@thekid thekid commented Jan 4, 2026

The problem with the current implementation is that it only initiates a new authentication flow if there was no previous flow in the session. If we pass ?state=<anything> and a previous authentication flow was present, we would reach the flow error.

$stored= $session->value($this->namespace);
$state= $request->param('state');

if (null === $state || null === $stored) {  // <-- here!
  // Start authentication flow
  // [...]
  return;
}

if ($target= $stored[$state] ?? null) {
  // Fetch access token, redirect to self
  // [...]
  return;
}

// This is reached if $stored= ['previous' => ...]
throw new IllegalStateException('Flow error');

This new implementation starts a new authentication flow in this case.

@thekid thekid merged commit 4e1098c into master Jan 4, 2026
14 checks passed
@thekid thekid deleted the refactor/oauth branch January 4, 2026 15:01
@thekid
Copy link
Member Author

thekid commented Jan 4, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants