Skip to content

Commit

Permalink
Configure Djoser and social auth
Browse files Browse the repository at this point in the history
  • Loading branch information
DEENUU1 committed Dec 17, 2023
1 parent e9360c2 commit 7a1a084
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion fjob/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
'drf_yasg',
'rest_framework_swagger',
'django_filters',
'social_django',

]

Expand All @@ -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'
Expand All @@ -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'
Expand Down

0 comments on commit 7a1a084

Please sign in to comment.