You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to useSession(token?: string), but I am not sure how that would interact with Context.memo
Alternatively Session.validate(token: string) can be added which will use the same internals as useSession 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:
sashalikesplanes
changed the title
Create Session.validate
Create a way to manually validate a Session token
Mar 23, 2024
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: