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

If there is an expired cookie, redirect the user to /login #14

Open
Tracked by #1
nathanclevenger opened this issue Sep 27, 2022 · 2 comments
Open
Tracked by #1

If there is an expired cookie, redirect the user to /login #14

nathanclevenger opened this issue Sep 27, 2022 · 2 comments

Comments

@nathanclevenger
Copy link
Member

No description provided.

@nathanclevenger nathanclevenger mentioned this issue Nov 23, 2022
18 tasks
@sam-lippert sam-lippert closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2022
@sam-lippert sam-lippert reopened this Nov 30, 2022
@sam-lippert
Copy link
Contributor

Should we keep a second, longer-lived cookie that is also cleared by logout? That way, we can differentiate between a first visit, an expired session, and a logout.

@nathanclevenger
Copy link
Member Author

Should we keep a second, longer-lived cookie that is also cleared by logout? That way, we can differentiate between a first visit, an expired session, and a logout.

I think it's simpler than that - cookies should always have max TTL so they never expire. If we validate a JWT that is expired, then we should redirect to /login so that the token is updated. The other issue here is that popular frameworks like next-auth prevent this token expiration by constantly re-issuing tokens with an updated expiration every time it's interacted with. The problem we're having here is that even with constant use, our users are constantly logged out over time.

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