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:
parent
93aa10d98d
commit
eafa2bbe75
@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import smtplib
|
import smtplib
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .local import *
|
from .local import *
|
||||||
@ -122,6 +123,19 @@ REST_FRAMEWORK = {
|
|||||||
|
|
||||||
REST_USE_JWT = True
|
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'
|
AUTH_USER_MODEL = 'user.User'
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
|
|||||||
@ -5,7 +5,7 @@ chardet==4.0.0
|
|||||||
cryptography==3.4.7
|
cryptography==3.4.7
|
||||||
defusedxml==0.7.1
|
defusedxml==0.7.1
|
||||||
dj-database-url==0.5.0
|
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-rest-swagger==2.2.0
|
||||||
Django==3.2.3
|
Django==3.2.3
|
||||||
django-allauth==0.44.0
|
django-allauth==0.44.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user