Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit e4a3c66

Browse files
committed
[refresh-token] add scenario/use case to readme
1 parent 90303f0 commit e4a3c66

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ $ curl -X POST -H "Content-Type: application/json" -d '{"token":"<EXISTING_TOKEN
7575

7676
Refresh with tokens can be repeated (token1 -> token2 -> token3), but this chain of token stores the time that the original token (obtained with username/password credentials), as `orig_iat`. You can only keep refreshing tokens up to `JWT_TOKEN_REFRESH_LIMIT`.
7777

78+
A typical use case might be a web app where you'd like to keep the user "logged in" the site without having to re-enter their password, or get kicked out by surprise before their token expired. Imagine they had a 1-hour token and are just at the last minute while they're still doing something. With mobile you could perhaps store the username/password to get a new token, but this is not a great idea in a browser. Each time the user loads the page, you can check if there is an existing non-expired token and if it's close to being expired, refresh it to extend their session. In other words, if a user is actively using your site, they can keep their "session" alive.
7879

7980
## Additional Settings
8081
There are some additional settings that you can override similar to how you'd do it with Django REST framework itself. Here are all the available defaults.

0 commit comments

Comments
 (0)