Title: Bug: Clicking one external auth button disables all other auth buttons on workspace creation page · Issue #22420 · coder/coder · GitHub
Open Graph Title: Bug: Clicking one external auth button disables all other auth buttons on workspace creation page · Issue #22420 · coder/coder
X Title: Bug: Clicking one external auth button disables all other auth buttons on workspace creation page · Issue #22420 · coder/coder
Description: Description When a template requires multiple coder_external_auth providers (e.g., GitLab and an OIDC provider), clicking the "Login with..." button for one provider causes all other auth buttons to show a loading spinner and become disa...
Open Graph Description: Description When a template requires multiple coder_external_auth providers (e.g., GitLab and an OIDC provider), clicking the "Login with..." button for one provider causes all other auth buttons t...
X Description: Description When a template requires multiple coder_external_auth providers (e.g., GitLab and an OIDC provider), clicking the "Login with..." button for one provider causes all other auth...
Opengraph URL: https://github.com/coder/coder/issues/22420
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: Clicking one external auth button disables all other auth buttons on workspace creation page","articleBody":"## Description\n\nWhen a template requires multiple `coder_external_auth` providers (e.g., GitLab and an OIDC provider), clicking the \"Login with...\" button for one provider causes **all other auth buttons** to show a loading spinner and become disabled. The user cannot interact with the second auth button until they refresh the page after completing the first authentication.\n\n## Environment\n\n- Coder version: 2.29.6\n- Browser: Chrome (likely affects all browsers)\n\n## Steps to Reproduce\n\n1. Configure two or more external auth providers in Coder (e.g., GitLab and an OIDC/PING provider)\n2. Create a template that requires both providers using `coder_external_auth` data sources:\n ```hcl\n data \"coder_external_auth\" \"provider_a\" {\n id = \"provider-a\"\n }\n\n data \"coder_external_auth\" \"provider_b\" {\n id = \"provider-b\"\n }\n ```\n3. Navigate to the \"Create Workspace\" page for that template\n4. Observe two auth buttons under \"External Authentication\"\n5. Click the \"Login with...\" button for the first provider\n\n## Expected Behavior\n\nOnly the clicked provider's button should show a loading spinner. The second provider's button should remain clickable so the user can authenticate with both providers without a page refresh.\n\n## Actual Behavior\n\nBoth buttons immediately show a loading spinner and become disabled. The second button cannot be clicked until the page is refreshed after the first auth completes.\n\n## Current Workaround\n\nUsers must:\n1. Click the first auth button and complete authentication\n2. Refresh the page\n3. Click the second auth button\n\nThis works because after refresh, the first provider is already authenticated, leaving only one unauthenticated button.\n\n## Root Cause Analysis\n\nThe `externalAuthPollingState` is a **single shared state** for all external auth providers. When any button is clicked, `startPollingExternalAuth()` sets the global state to `\"polling\"`, and every `ExternalAuthButton` receives the same `isLoading` prop:\n\n**`CreateWorkspacePageView.tsx` (~line 536):**\n```tsx\n{externalAuth.map((auth) => (\n \u003cExternalAuthButton\n key={auth.id}\n auth={auth}\n isLoading={externalAuthPollingState === \"polling\"}\n onStartPolling={startPollingExternalAuth}\n displayRetry={externalAuthPollingState === \"abandoned\"}\n />\n))}\n```\n\n**`CreateWorkspacePage.tsx` (~line 365):**\n```tsx\nconst useExternalAuth = (versionId: string | undefined) => {\n const [externalAuthPollingState, setExternalAuthPollingState] =\n useState\u003cExternalAuthPollingState>(\"idle\");\n // ... single state shared across ALL providers\n};\n```\n\nAdditionally, polling stops only when `allSignedIn` is true (every provider is authenticated), so even after the first auth succeeds, the polling state won't revert to `\"idle\"` until the second provider also authenticates — which the user can't trigger because its button is disabled.\n\n## Suggested Fix\n\nMake the polling state per-provider instead of global, e.g., using a `Map\u003cstring, ExternalAuthPollingState>` keyed by auth provider ID, so each button independently tracks its own polling/loading/abandoned state.\n\n---\n\n*Created on behalf of a user.*","author":{"url":"https://github.com/apps/blinkagent","@type":"Person","name":"blinkagent"},"datePublished":"2026-02-27T22:11:56Z","url":"https://github.com/coder/coder/issues/22420"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4238bbd5-1086-0147-7196-176ba90d78a0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B05C:29AEE8:1C13976:255AFFA:6B0160CB |
| html-safe-nonce | 9d9cf488ae0be9848a2f758f01b8603c92e680d92f986121d771e7f169c73013 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDVDOjI5QUVFODoxQzEzOTc2OjI1NUFGRkE6NkIwMTYwQ0IiLCJ2aXNpdG9yX2lkIjoiNzIwNjczOTQ0ODQwNTUxNjQ5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7b514529f9722623ffee63187c995bde9fc13013c37f2ea2ae5a3cb7b8893124 |
| hovercard-subject-tag | issue:4003091392 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/22420/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c64e812a3e2b717773ccc1adf2b9d40fd3af78492723eced645a0c806dc04555/coder/coder/issues/22420 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c64e812a3e2b717773ccc1adf2b9d40fd3af78492723eced645a0c806dc04555/coder/coder/issues/22420 |
| og:image:alt | Description When a template requires multiple coder_external_auth providers (e.g., GitLab and an OIDC provider), clicking the "Login with..." button for one provider causes all other auth buttons t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blinkagent[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width