Repository navigation
Sign-in page shows only the methods that work - #307
Merged
Merged
Conversation
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.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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_idand 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) readsGET /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.?signin_error=not_set_up(the API's answer toGET /auth/githubwith no client) reads "GitHub sign-in isn't set up on this Coderhelm. Sign in with your email and password." with no Try again.sign-in-methods.spec.ts.hybrid-jira-email.spec.tsno longer expects a GitHub button on a self-hosted install with no list, andaudit-shell.spec.tsmocks 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, thenot_set_upnotice, and the removed-app link both ways.integrations-page.spec.ts"members see Integrations lit") passed on rerun.