-
Notifications
You must be signed in to change notification settings - Fork 15
Rough implementation of OpenID Connect. #1135
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
Conversation
fa7b163
to
3d717db
Compare
3d717db
to
3284e11
Compare
09ea524
to
46d0611
Compare
09d94d6
to
8829924
Compare
8829924
to
353b542
Compare
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.
looks ok to me, I didn't read the middleware functions part in great detail however.
const response = await basicFetch(input, { ...init, headers }); | ||
|
||
if (response.status === 401) { | ||
// TODO: here, we use the new tokens for the current request, but it is |
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.
comment still relevant ?
failureRedirect: getRoute('/sign-in'), | ||
}); | ||
|
||
const res = await next({ context: { authInfo } }); |
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.
just testing my understanding of your middleware function: should we not call next with the received context to which we add authInfo ?
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.
The merge on the context sent to next
and the previous one is automatically merge. You only need to send the new context properties you want to set.
f5bed9e
to
3b5984d
Compare
3b5984d
to
f813572
Compare
DO NOT MERGE
See checkmarble/marble-backend#1204.
This is not mergeable, for several reasons, it will need an actual frontend engineer to clean up, handle edge cases, and support refresh.
Also, note that there is no error handling. If the IDP returns an error, it will be displayed as plain text in the browser. :D