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
Create a way to manually validate a Session token #3724
Comments
Is this for the current Auth construct or future-auth? |
Current Auth construct, specifically the Session component of it
…On Wed, 27 Mar 2024, 00:47 Jay, ***@***.***> wrote:
Is this for the current Auth construct or future-auth?
—
Reply to this email directly, view it on GitHub
<#3724 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATCHQBEXLPU7V6PB46SVCE3Y2ICIRAVCNFSM6AAAAABFE2YIMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGY3DAMZXGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@sashalikesplanes The future-auth construct provides a method called Though I agree this functionality would be nice to have in the base auth and could probably be pulled out into a common piece of code called in both places, just as it is done in future-auth. @jayair Is there a plan to make future-auth the primary auth or is that not part of the roadmap anymore due to the release of SST Ion? |
I've stumbled upon a use case where I had to pass a JWT token created by
Session
through a query parameter.I do not see any way to manually verify if a token was created by
Session
.I propose to adjust the
useSession
by changing the signature touseSession(token?: string)
, but I am not sure how that would interact withContext.memo
Alternatively
Session.validate(token: string)
can be added which will use the same internals asuseSession
to validate the token with an identical return type.Having read through the code in
session.ts
I believe I could implement such a feature.Are you open to merging such a PR? Which approach suits your style better?
The text was updated successfully, but these errors were encountered: