-
Notifications
You must be signed in to change notification settings - Fork 126
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
How do you redirect if a token has expired? #161
Comments
good question @traducer |
@traducer & @goncalvesr2 we have just released an update to |
Just chiming in here to say I followed @nelsonic 's advice with utilizing an |
This seems a bit trivial, however, I have not used JWT with Hapi.js before. Currently I am testing my auth flow by having a user login via a form, and wrapping a cookie with a JWT back to the client. For testing purposes I'm making the token expire in 1 minute. I want to be able to redirect to the /login view if the token has expired. The default behavior for this plugin seems to be a 401 response, which makes sense but if I want to capture this and redirect, I'm not exactly sure how to do it. I've tried setting ignoreExpiration to true, but I believe validateFunc isn't responsible for redirects of any kind.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: