mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 05:43:44 +03:00
Fixes JWT_TOKEN_CLAIMS_SERIALIZER get attribute
This commit is contained in:
parent
888791915b
commit
b15400e9c4
|
@ -19,7 +19,14 @@ def default_create_token(token_model, user, serializer):
|
||||||
|
|
||||||
def jwt_encode(user):
|
def jwt_encode(user):
|
||||||
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
|
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
|
||||||
TOPS = import_callable(getattr(settings, 'JWT_TOKEN_CLAIMS_SERIALIZER', TokenObtainPairSerializer))
|
rest_auth_serializers = getattr(settings, 'REST_AUTH_SERIALIZERS', {})
|
||||||
|
|
||||||
|
JWTTokenClaimsSerializer = rest_auth_serializers.get(
|
||||||
|
'JWT_TOKEN_CLAIMS_SERIALIZER',
|
||||||
|
TokenObtainPairSerializer
|
||||||
|
)
|
||||||
|
|
||||||
|
TOPS = import_callable(JWTTokenClaimsSerializer)
|
||||||
refresh = TOPS.get_token(user)
|
refresh = TOPS.get_token(user)
|
||||||
return refresh.access_token, refresh
|
return refresh.access_token, refresh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user