def jwt_create_payload(cls, *args, **kwargs):
     return api_settings.JWT_PAYLOAD_HANDLER(*args, **kwargs)
Beispiel #2
0
def get_token(user):
    return api_settings.JWT_ENCODE_HANDLER(api_settings.JWT_PAYLOAD_HANDLER(user))
Beispiel #3
0
 def create_jwt(self) -> str:
     payload = api_settings.JWT_PAYLOAD_HANDLER(self)
     return api_settings.JWT_ENCODE_HANDLER(payload)
Beispiel #4
0
 def get_token(self, obj):  # instance of the model
     user = obj
     payload = api_settings.JWT_PAYLOAD_HANDLER(user)
     token = api_settings.JWT_ENCODE_HANDLER(payload)
     return token
def encode_jwt(user):
    return api_settings.JWT_ENCODE_HANDLER(
        api_settings.JWT_PAYLOAD_HANDLER(user))
Beispiel #6
0
def get_token(user):
    payload = api_settings.JWT_PAYLOAD_HANDLER(user)
    token = api_settings.JWT_ENCODE_HANDLER(payload)

    return token
Beispiel #7
0
def create_auth_token(sender, instance=None, created=False, **kwargs):
    if created:
        refresh_token = api_settings.JWT_ENCODE_HANDLER(
            api_settings.JWT_PAYLOAD_HANDLER(instance))
        RefreshableExpiringToken.objects.create(user=instance,
                                                refresh_token=refresh_token)
Beispiel #8
0
 def get_token(self, obj):
     payload = api_settings.JWT_PAYLOAD_HANDLER(obj)
     token = api_settings.JWT_ENCODE_HANDLER(payload)
     return token