fix(site): set external auth provider polling status individually#26313
Merged
Conversation
…der external auth Adds CreateWorkspacePage.stories.tsx with four stories covering the multi-provider external auth bug described in #22420: - MultipleExternalAuth: both buttons render enabled - ClickingOneAuthDoesNotDisableOthers: regression test for #22420 - OneProviderAuthenticated: mixed authenticated/unauthenticated state - SequentialAuthFlow: full polling flow with mockResolvedValueOnce
The external auth polling state was a single shared value for all providers. Clicking one provider's Login button set the global state to "polling", which disabled every other provider's button. Users had to refresh the page between each authentication. Change the state from a single ExternalAuthPollingState string to a Record<string, ExternalAuthPollingState> keyed by provider ID. Each provider now independently tracks idle, polling, and abandoned states. The query refetchInterval activates when any provider is polling and each provider has its own 60-second timeout. Fixes #22420
… MockTemplateVersionExternalAuthAzure
aqandrew
commented
Jun 11, 2026
aslilac
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #22420
ref DEVEX-369
ref DEVEX-269
The bug on
CreateWorkspacePage, where clicking one external auth provider login button disabled all providers' login buttons, was caused by providers all sharing a single polling status ("idle" | "polling" | "abandoned") in theuseExternalAuthhook.changes
useExternalAuthis now tracked for each provider in a record whose keys are the providers' IDs.CreateWorkspacePage'suseExternalAuthhook in favor of the globaluseExternalAuthhook (see refactor(site): use global useExternalAuth hook for CreateWorkspacePage #26310)(co-written with Coder Agents)