Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

generate jwt token just passing userid in rest_framework_simplejwt

from rest_framework_simplejwt.tokens import RefreshToken, SlidingToken, UntypedToken
from django.conrtib.auth.models import User

user = User.objects.first()
SlidingToken.for_user(user)
RefreshToken.for_user(user)
str(RefreshToken.for_user(user))
str(RefreshToken.for_user(user).access_token)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generate #jwt #token #passing #userid
ADD COMMENT
Topic
Name
7+9 =