|
|
|
@ -17,6 +17,7 @@ def custom_jwt_payload_handler(user): |
|
|
|
'exp': datetime.utcnow() + api_settings.JWT_EXPIRATION_DELTA, |
|
|
|
'exp': datetime.utcnow() + api_settings.JWT_EXPIRATION_DELTA, |
|
|
|
'out_key': str(user.out_key), |
|
|
|
'out_key': str(user.out_key), |
|
|
|
'email': user.email, |
|
|
|
'email': user.email, |
|
|
|
|
|
|
|
'real': True, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if api_settings.JWT_ALLOW_REFRESH: |
|
|
|
if api_settings.JWT_ALLOW_REFRESH: |
|
|
|
@ -34,13 +35,7 @@ def custom_jwt_payload_handler(user): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class JSONWebTokenAuthentication(BaseJSONWebTokenAuthentication): |
|
|
|
class JSONWebTokenAuthentication(BaseJSONWebTokenAuthentication): |
|
|
|
""" |
|
|
|
|
|
|
|
Clients should authenticate by passing the token key in the "Authorization" |
|
|
|
|
|
|
|
HTTP header, prepended with the string specified in the setting |
|
|
|
|
|
|
|
`JWT_AUTH_HEADER_PREFIX`. For example: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authorization: JWT eyJhbGciOiAiSFMyNTYiLCAidHlwIj |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
www_authenticate_realm = 'api' |
|
|
|
www_authenticate_realm = 'api' |
|
|
|
|
|
|
|
|
|
|
|
def get_jwt_value(self, request): |
|
|
|
def get_jwt_value(self, request): |
|
|
|
|