working on manual logout: block access token
This commit is contained in:
9
apps/authentication/tools.py
Normal file
9
apps/authentication/tools.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from rest_framework_simplejwt.tokens import AccessToken
|
||||
|
||||
|
||||
def get_token_jti(token_str):
|
||||
try:
|
||||
token = AccessToken(token_str)
|
||||
return token['jti'], token['user_id']
|
||||
except Exception as e:
|
||||
return None, None
|
||||
Reference in New Issue
Block a user