-
Notifications
You must be signed in to change notification settings - Fork 10
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(backend): Introduce handshake & extract logic auth logic to separate classes #45
Conversation
def resolve_cookie_token(env) | ||
# in cross-origin XHRs the use of Authorization header is mandatory. | ||
# TODO: add reason | ||
return signed_out if auth_context.cross_origin_request? |
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.
❓ Shouldn't this check go to the resolve_header_token method?
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.
Since the condition used to execute the resolve_header_token
flow is the existence of a header_token
and the case described here is that we want to return a signed_out
state if it's a cross-origin request and there is no header_token, it will never be triggered in the resolve_header_token
flow.
e311ddf
to
e7ef512
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.
lot of this goes over my head. If it works, I'm excited!
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 good to me overall, but I admit that the handshake implementation is a bit hard to follow.
Might be just me though.
Great work on a tough problem!
dd05709
to
c7ef5f1
Compare
Changes made in this PR
Clerk::SDK#interstitial
method (it should not be used by any customer since this is internal)AuthenticateRequest
classAuthenticateContext
class (Parameter object pattern)Customer impact
CLERK_PUBLISHABLE_KEY
env which is required for the handshake to work properlyCLERK_SECRET_KEY
should use the formatsk_test | sk_live
formatTODO
Next Steps