|
|
|
|
@ -128,12 +128,14 @@ MIDDLEWARE_CLASSES = [ |
|
|
|
|
|
|
|
|
|
REST_FRAMEWORK = { |
|
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': ( |
|
|
|
|
'lms.utils.JSONWebTokenAuthentication', |
|
|
|
|
'rest_framework.authentication.SessionAuthentication', |
|
|
|
|
'rest_framework.authentication.BasicAuthentication', |
|
|
|
|
), |
|
|
|
|
'DEFAULT_PARSER_CLASSES': [ |
|
|
|
|
'rest_framework_jwt.authentication.JSONWebTokenAuthentication', |
|
|
|
|
'rest_framework.authentication.SessionAuthentication', |
|
|
|
|
'rest_framework.authentication.BasicAuthentication', |
|
|
|
|
'rest_framework.parsers.FormParser', |
|
|
|
|
'rest_framework.parsers.MultiPartParser', |
|
|
|
|
'rest_framework.parsers.JSONParser', |
|
|
|
|
], |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -268,11 +270,11 @@ JWT_AUTH = { |
|
|
|
|
'JWT_PAYLOAD_HANDLER': |
|
|
|
|
'lms.utils.custom_jwt_payload_handler', |
|
|
|
|
|
|
|
|
|
'JWT_PAYLOAD_GET_USER_ID_HANDLER': |
|
|
|
|
'rest_framework_jwt.utils.jwt_get_user_id_from_payload_handler', |
|
|
|
|
'JWT_PAYLOAD_GET_USERNAME_HANDLER': |
|
|
|
|
'lms.tools.custom_jwt_get_user_email', |
|
|
|
|
|
|
|
|
|
'JWT_RESPONSE_PAYLOAD_HANDLER': |
|
|
|
|
'rest_framework_jwt.utils.jwt_response_payload_handler', |
|
|
|
|
'lms.utils.jwt_response_payload_handler', |
|
|
|
|
|
|
|
|
|
'JWT_SECRET_KEY': SECRET_KEY, |
|
|
|
|
'JWT_GET_USER_SECRET_KEY': None, |
|
|
|
|
@ -282,7 +284,7 @@ JWT_AUTH = { |
|
|
|
|
'JWT_VERIFY': True, |
|
|
|
|
'JWT_VERIFY_EXPIRATION': True, |
|
|
|
|
'JWT_LEEWAY': 0, |
|
|
|
|
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300), |
|
|
|
|
'JWT_EXPIRATION_DELTA': datetime.timedelta(days=1), |
|
|
|
|
'JWT_AUDIENCE': 'Skillbox_Login', |
|
|
|
|
'JWT_ISSUER': 'LMS', |
|
|
|
|
|
|
|
|
|
|