Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings
import zoneinfo
from pathlib import Path
from urllib.parse import urlparse
from urllib.parse import urljoin, urlparse

from celery.schedules import crontab
from decouple import (
Expand Down Expand Up @@ -503,7 +503,9 @@ def secret(key, default=undefined, **kwargs):
# Empty CSRF_TRUSTED_ORIGINS, default to http
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "http"

ACCOUNT_LOGOUT_REDIRECT_URL = "/accounts/login/?loggedout=1"
ACCOUNT_LOGOUT_REDIRECT_URL = config(
"ACCOUNT_LOGOUT_REDIRECT_URL", default="/accounts/login/?loggedout=1",
)
ACCOUNT_SESSION_REMEMBER = True
ACCOUNT_USER_MODEL_EMAIL_FIELD = None
ACCOUNT_FORMS = {
Expand All @@ -512,7 +514,9 @@ def secret(key, default=undefined, **kwargs):
}

if BASE_URL:
ACCOUNT_LOGOUT_REDIRECT_URL = f"{BASE_URL}/accounts/login/?loggedout=1"
# Join base only if relative URL
if not urlparse(ACCOUNT_LOGOUT_REDIRECT_URL).netloc:
ACCOUNT_LOGOUT_REDIRECT_URL = urljoin(BASE_URL, ACCOUNT_LOGOUT_REDIRECT_URL)
SESSION_COOKIE_PATH = BASE_URL + "/"

SOCIALACCOUNT_LOGIN_ON_GET = True
Expand Down