-
Notifications
You must be signed in to change notification settings - Fork 887
feat: Add GitHub OAuth #1050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add GitHub OAuth #1050
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1050 +/- ##
==========================================
- Coverage 66.56% 57.47% -9.09%
==========================================
Files 255 257 +2
Lines 15743 16011 +268
Branches 152 156 +4
==========================================
- Hits 10479 9202 -1277
- Misses 4196 5815 +1619
+ Partials 1068 994 -74
Continue to review full report at Codecov.
|
@presleyp this is my first time working with XState, so it's very possible I did something wrong... just let me know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really basic right now, but figured we could pretty it up in a future PR (happy to do it here if y'all would like).
I think it's the right call to re-design later, and move things like strings and icons to the backend response. What's here looks awesome for now, nicely done!
This is awesome 🎉 !
Looks great! Can you add stories to |
@presleyp I added the stories listed, and now display an error for auth methods. I noticed right now we don't display the backend error for responses, and I'm curious if we should do that instead? Regardless, I followed the existing style and added it to I also improved the tests with mocks and checked for the error state. |
Yeah, I think so! Thanks for adding stories! |
@deansheather approved via Slack ☑ |
This adds scaffolding for future OAuth providers and adds a real implementation for GitHub.
/users/authmethods
endpoint to detect whether GitHub authentication is enabled. It returnspassword
as well, which is currently statically set totrue
.built-in
login type topassword
. It felt like a better name (happy to discuss this).This intentionally avoids allowing multiple GitHub OAuth configs. External providers like Okta should be recommended in that scenario. This has worked for Sourcegraph, so I think it's fair to say we'll be fine for a while.
I've added configuration as CLI flags for now. In the future, we'll be moving this to a config that would look something like:
In a future PR, I'll be separating access and refresh tokens from API keys. They should be attached to a user, not a specific token.