Files
RasadDam_Backend/apps/authentication/tools.py

12 lines
291 B
Python
Raw Normal View History

from rest_framework_simplejwt.tokens import AccessToken
def get_token_jti(token_str):
2025-06-02 15:26:49 +03:30
""" get generated jwt id (jti) for every token """
try:
token = AccessToken(token_str)
return token['jti'], token['user_id']
except Exception as e:
return None, None