auth works now

This commit is contained in:
2023-05-24 11:46:10 +03:00
parent bb225e5fb5
commit 4609ca23fa
8 changed files with 84 additions and 37 deletions

View File

@ -0,0 +1,9 @@
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
from rest_framework_simplejwt.views import TokenObtainPairView
class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
@classmethod
def get_token(cls, user):
token = super().get_token(user)
token['username'] = user.username
return token