Skip to content

Sign-in page shows only the methods that work - #307

Merged
nambok merged 1 commit into
mainfrom
github-sign-in-only-when-it-works
Nov 3, 2026
Merged

nambok merged 1 commit into
mainfrom
github-sign-in-only-when-it-works

Conversation

@nambok

@nambok nambok commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

The sign-in page offered Continue with GitHub on every deployment. On a self-hosted install that uses CoderHelm's GitHub App (hybrid) there is no GitHub OAuth client, so the button went to GitHub with an empty client_id and GitHub answered 404. The page now shows only the sign-in methods the API says work (GET /auth/methods, CoderHelm/coderhelm-platform#456).

Changes

  • useSignInMethods (new hook) reads GET /auth/methods. Google and GitHub show only when listed, and the "or" divider is hidden when neither is. Until the API answers, or when it has no list yet (an older gateway), the hosted service keeps both buttons and a self-hosted install shows email and password only.
  • The removed-app screen's Then sign in with GitHub again link follows the same list.
  • ?signin_error=not_set_up (the API's answer to GET /auth/github with no client) reads "GitHub sign-in isn't set up on this Coderhelm. Sign in with your email and password." with no Try again.
  • e2e: new sign-in-methods.spec.ts. hybrid-jira-email.spec.ts no longer expects a GitHub button on a self-hosted install with no list, and audit-shell.spec.ts mocks the list.

Verification

  • npm run lint, tsc --noEmit, npm run build (static export).
  • sign-in-methods.spec.ts: hybrid install with no client (no GitHub, no Google, no "or"), self-hosted with its own client (GitHub to /auth/github), self-hosted API with no list (no GitHub), hosted with the list both ways and with no list, the not_set_up notice, and the removed-app link both ways.
  • Full e2e suite against the static build: 1281 passed, 10 skipped. One unrelated failure (integrations-page.spec.ts "members see Integrations lit") passed on rerun.

The sign-in page offered Continue with GitHub everywhere. On a hybrid
install with no GitHub OAuth client of its own it led to GitHub's 404.

- Reads GET /auth/methods and shows Google and GitHub only when the API
  lists them; no 'or' divider when neither is there. Until it answers
  (or on an older API) the hosted service keeps both and a self-hosted
  install shows email and password only.
- The removed-app screen's 'Then sign in with GitHub again' follows the
  same list.
- signin_error=not_set_up reads 'GitHub sign-in isn't set up on this
  Coderhelm. Sign in with your email and password.' with no Try again.
- e2e: sign-in-methods.spec.ts covers the list both ways, an API with
  no list, the not_set_up notice and the removed-app link.
@nambok
nambok merged commit 4ffce1c into main Nov 3, 2026
10 checks passed
@nambok
nambok deleted the github-sign-in-only-when-it-works branch November 3, 2026 20:23
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.

1 participant