Handle auth in front end#142
Merged
Merged
Conversation
smacker
suggested changes
Feb 20, 2018
smacker
left a comment
Contributor
There was a problem hiding this comment.
- You can't read POST payload in javascript
So your idea FE->BE->reponse doesn't work.
- You don't handle errors from provider:
https://tools.ietf.org/html/rfc6749#section-4.1.2.1
And we have to provide those errors to the user because those are problems between user&provider, not our app.
Contributor
Author
|
Contributor
Author
|
It must be rebased over master and refactored considering #144 |
This was referenced Mar 5, 2018
smacker
suggested changes
Mar 6, 2018
smacker
left a comment
Contributor
There was a problem hiding this comment.
Oh. You cherry-picked my commits. Okay.
One small comment about error handling.
| rand.Read(b) | ||
| state := base64.URLEncoding.EncodeToString(b) | ||
|
|
||
| session, _ := o.store.Get(r, "sess") |
Contributor
There was a problem hiding this comment.
if you return (string, error), it makes sense to handle error here too.
Contributor
Author
There was a problem hiding this comment.
yesssss, you're totally right; thanks for spotting it!
carlosms
approved these changes
Mar 6, 2018
Contributor
Author
|
Ready for a second pass @bzz @smacker
|
smacker
approved these changes
Mar 6, 2018
Signed-off-by: Maxim Sukharev <maxim@sourced.tech>
Signed-off-by: Maxim Sukharev <maxim@sourced.tech>
Signed-off-by: Maxim Sukharev <maxim@sourced.tech>
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.
Fix #99
major changes:
/auth:stateandcodefrom GitHub OAuth callback,/api/authendpoint, and handle any possible error,UI_DOMAINis no longer needed in Helm chartsbenefits:
/api/authendpoint will be standard in terms of ourhandler.RequestProcessFunc,FE → BE → response + status
possible improvements:
/authroute is not really-really needed because the auth thing could be handled by/itself ifcodeis received.