Skip to content

Commit fe97c0b

Browse files
committed
fix
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
1 parent 916672c commit fe97c0b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

authentik/root/settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from pathlib import Path
88

99
from celery.schedules import crontab
10+
from django.conf import ImproperlyConfigured
1011
from sentry_sdk import set_tag
1112

1213
from authentik import ENV_GIT_HASH_KEY, __version__
@@ -213,11 +214,13 @@
213214
DJANGO_REDIS_LOG_IGNORED_EXCEPTIONS = True
214215
match CONFIG.get("session_storage", "cache"):
215216
case "cache":
216-
SESSION_ENGINE = "django.contrib.sessions.backends.db"
217+
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
217218
case "db":
218219
SESSION_ENGINE = "django.contrib.sessions.backends.db"
219220
case _:
220-
raise ValueError("Invalid session_storage setting, allowed values are db and cache")
221+
raise ImproperlyConfigured(
222+
"Invalid session_storage setting, allowed values are db and cache"
223+
)
221224
SESSION_SERIALIZER = "authentik.root.sessions.pickle.PickleSerializer"
222225
SESSION_CACHE_ALIAS = "default"
223226
# Configured via custom SessionMiddleware

website/docs/installation/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Defaults to `86400`.
319319
Requires authentik 2024.4
320320
:::
321321

322-
Configure if the sessions are stored in the cache or the database. Defaults to `cache`. Allowed values are `cache` and `db`.
322+
Configure if the sessions are stored in the cache or the database. Defaults to `cache`. Allowed values are `cache` and `db`. Note that changing this value will invalidate all previous sessions.
323323

324324
### `AUTHENTIK_WEB__WORKERS`
325325

0 commit comments

Comments
 (0)