Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
The flow to connect GitHub external auth to Coder using the device flow is as follows:
- User clicks on the "Login with GitHub" button on https://dev.coder.com/settings/external-auth
- User is redirected https://dev.coder.com/external-auth/github
- User copies code, opens GitHub, pastes the code, authorizes Coder
- User goes back to https://dev.coder.com/external-auth/github. The page polls https://dev.coder.com/api/v2/external-auth/github/device every 5 seconds, which in turn polls GitHub. If the user completed the GitHub authorization process, Coder receives OAuth tokens from GitHub, and saves external auth information in the database.
However, if the user completes step 3 but doesn't move on to step 4, Coder will not poll GitHub and never complete the authentication flow. This can very easily happen on Windows with Chrome when the https://dev.coder.com/external-auth/github page is opened in a pop up window. The user only opens the window to copy the code - there's no natural reason to go back once they complete the flow on GitHub's side. @Jphalan ran into this: he'd go back to https://dev.coder.com/settings/external-auth instead and see a never-ending spinner.
A possible fix is to set refetchIntervalInBackground: true
on
Relevant Log Output
Expected Behavior
No response
Steps to Reproduce
See above.
Environment
- Host OS:
- Coder version:
Additional Context
No response