-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
What happens when the access token expires #400
Comments
When the access token expires, a user would need to login again, sending a request to the backend's |
@csmcallister: Where in the code it is actually enforced? |
@emsi Take a look here first: Then follow the core.security import to here: As you can see there, the expiration is either pulled in from the app settings or can be overridden with a custom value. The jwt library is responsible for taking in that expiration value. Their docs explain how expiration is determined and enforced: https://pyjwt.readthedocs.io/en/latest/usage.html |
@emsi stumbled upon this today. In addition to @csmcallister's hints, you can use the |
Is there something planned to handle the expiration? |
Yeah I'm definitely experiencing and endless loop of It seems that, it doesn't actually check if token is expired, only that it is present. full-stack-fastapi-template/frontend/src/hooks/useAuth.ts Lines 16 to 18 in 5005e5a
|
Same issue here. If the user leaves the browser window open for a while then comes back, the app appears to be broken, i.e. the backend returns 403, but the frontend doesn't report this to the user, only hangs. Suggestions:
Edit: here's a patch for the frontend (untested):
|
After some experiments with expired/ |
Hi!
Looking through the sources of the backend and frontend I can't figure out what happens when the JWT access token expires. Is there a strategy in place to extend the access token if the user is using it frequently?
The text was updated successfully, but these errors were encountered: