diff --git a/fjob/settings.py b/fjob/settings.py index bd900de..933c38b 100644 --- a/fjob/settings.py +++ b/fjob/settings.py @@ -66,6 +66,7 @@ 'drf_yasg', 'rest_framework_swagger', 'django_filters', + 'social_django', ] @@ -86,6 +87,22 @@ # Authentication +AUTHENTICATION_BACKENDS = [ + 'social_core.backends.google.GoogleOAuth2', + 'social_core.backends.facebook.FacebookOAuth2', + 'django.contrib.auth.backends.ModelBackend', +] + +DJOSER = { + 'PASSWORD_RESET_CONFIRM_URL': 'password-reset/{uid}/{token}', + 'SEND_ACTIVATION_EMAIL': False, # Todo change to True + 'ACTIVATION_URL': 'activation/{uid}/{token}', + 'USER_CREATE_PASSWORD_RETYPE': True, + 'PASSWORD_RESET_CONFIRM_RETYPE': True, + 'TOKEN_MODEL': None, + 'SOCIAL_AUTH_ALLOWED_REDIRECT_URIS': os.getenv('REDIRECT_URLS').split(',') +} + AUTH_COOKIE = 'access' AUTH_COOKIE_MAX_AGE = 60 * 60 * 24 AUTH_COOKIE_SECURE = os.getenv('AUTH_COOKIE_SECURE', 'True') == 'True' @@ -107,7 +124,6 @@ 'fields': 'email, first_name, last_name' } - CORS_ALLOWED_ORIGINS = os.getenv( 'CORS_ALLOWED_ORIGINS', 'http://localhost:3000,http://127.0.0.1:3000'