update dj-rest-auth; Add token expirations to login response; Set refresh expiration at 30 days, and access token at 1 day;

This commit is contained in:
David Gillespie 2024-05-08 19:31:57 -06:00
parent 93aa10d98d
commit eafa2bbe75
2 changed files with 15 additions and 1 deletions

View File

@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
import os
import smtplib
from datetime import timedelta
try:
from .local import *
@ -122,6 +123,19 @@ REST_FRAMEWORK = {
REST_USE_JWT = True
SIMPLE_JWT = {
'ACCESS_TOKEN_LIFETIME': timedelta(days=1),
'REFRESH_TOKEN_LIFETIME': timedelta(days=30),
}
REST_AUTH = {
"USE_JWT": True,
'JWT_AUTH_RETURN_EXPIRATION': True,
'JWT_AUTH_HTTPONLY': False,
}
AUTH_USER_MODEL = 'user.User'
# Password validation

View File

@ -5,7 +5,7 @@ chardet==4.0.0
cryptography==3.4.7
defusedxml==0.7.1
dj-database-url==0.5.0
dj-rest-auth==2.1.5
dj-rest-auth==3.0.0
django-rest-swagger==2.2.0
Django==3.2.3
django-allauth==0.44.0