Skip to content
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

Open
sashalikesplanes opened this issue Mar 23, 2024 · 2 comments
Open

Create a way to manually validate a Session token #3724

sashalikesplanes opened this issue Mar 23, 2024 · 2 comments

Comments

@sashalikesplanes
Copy link
Contributor

sashalikesplanes commented 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 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?

@sashalikesplanes sashalikesplanes changed the title Create Session.validate Create a way to manually validate a Session token Mar 23, 2024
@jayair
Copy link
Contributor

jayair commented Mar 26, 2024

Is this for the current Auth construct or future-auth?

@sashalikesplanes
Copy link
Contributor Author

sashalikesplanes commented Mar 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants