Skip to content

Commit fd05c88

Browse files
committed
add token expiry validation
1 parent 843ac9d commit fd05c88

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

chats/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async def __call__(self, scope, receive, send):
108108
# Look up user from query string
109109

110110
# TODO: (you should also do things like
111-
# checking if it is a valid user ID, or if scope["user"] is already
111+
# checking if it is a valid user ID, or if scope["user" ] is already
112112
# populated).
113113

114114
query_string = scope["query_string"].decode()

procollab/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"rest_framework_simplejwt",
8383
"rest_framework_simplejwt.token_blacklist",
8484
"django_cleanup.apps.CleanupConfig",
85-
"rest_framework.authtoken",
85+
# "rest_framework.authtoken",
8686
# Plugins
8787
"corsheaders",
8888
"django_filters",
@@ -262,7 +262,7 @@
262262
"UPDATE_LAST_LOGIN": False,
263263
"ALGORITHM": "HS256",
264264
"SIGNING_KEY": SECRET_KEY,
265-
"VERIFYING_KEY": None,
265+
"VERIFYING_KEY": True,
266266
"AUDIENCE": None,
267267
"ISSUER": None,
268268
"JWK_URL": None,
@@ -283,7 +283,7 @@
283283
}
284284

285285
if DEBUG:
286-
SIMPLE_JWT["ACCESS_TOKEN_LIFETIME"] = timedelta(weeks=1)
286+
SIMPLE_JWT["ACCESS_TOKEN_LIFETIME"] = timedelta(seconds=30)
287287

288288
SESSION_COOKIE_SECURE = False
289289

0 commit comments

Comments
 (0)