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

How I can create a token and refresh it without save it in the database? #21

Open
haristimuno05 opened this issue Feb 18, 2022 · 1 comment

Comments

@haristimuno05
Copy link

Hi!

It's possible create a token and refresh it without save it in the database? Any idea or implementation?

Thanks!

@Usama0121
Copy link
Owner

You can use the following settings for that

Use the token returned by token auth mutation to refresh the token

JWT_EXPIRATION_DELTA defines the expiry of token after it needs to be refreshed

JWT_REFRESH_EXPIRATION_DELTA defines the expiry of refresh so that your token cannot be refreshed again and requires token auth

 ​GRAPHQL_JWT​ ​=​ { 
 ​    ​'JWT_VERIFY_EXPIRATION'​: ​True​, 
 ​    ​'JWT_EXPIRATION_DELTA'​: ​timedelta​(​minutes​=​5​), 
 ​    ​'JWT_REFRESH_EXPIRATION_DELTA'​: ​timedelta​(​minutes​=​10​), 
 ​}

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