-
Notifications
You must be signed in to change notification settings - Fork 28
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
BREAKING: add getSessionData()
#295
base: main
Are you sure you want to change the base?
Conversation
getSessionObject()
getSessionData()
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.
LGTM
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.
LGTM again
sessionId, | ||
tokens, | ||
}; | ||
return response; |
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.
I think it may be useful to still return the tokens from this function. Either that pass the whole token object to tokenCallback
?
This used to be built into this module but got removed, which I understand the reasoning for, but I feel like some people may want the ability to ensure sessions are still valid and be able to refresh the access token in the cases that it is not.
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.
Sorry, what got removed?
Hm. I hadn't considered refresh tokens. Let me think about this and see what to do about it. Thanks for chiming in.
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.
It used to store the access/refresh tokens in KV and would automatically refresh the session but that was removed some time back. I remember fixing some bugs in that area but it was removed soon after
Previously, the dev would use
getSessionId()
to check whether the user is signed in. They'd then use thesessionId
value to perform database operations, such as getting some session/user object.Now, this is all done in a single step. The dev configures which data is saved to the database within
handleCallback()
.getSessionData()
then returns that data from a given request.Reviews, concerns and suggestions are welcome.