How can one auto regenerate a refresh_token within a django admin
app, am using simple jwt
package, but I want to track if the token has expired then I send a request to auto generate a new acces_token
, when the session is still on.
Yes I know this can be achieved on the frontend, forexample like in javascript we can use axios interceptors, to auto get another access_token
, so how can one do this in django it's self.
You could write a simple middleware that checks if the JWT is valid and if not, can regenerated one. See the middleware docs here: https://docs.djangoproject.com/en/3.2/topics/http/middleware/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.