feat(web): allow Redis session URL separate from app DB

Wire session_url through app.auth/listen so sites can store sessions in
Redis while keeping Postgres/SQLite for application data.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-18 14:59:50 +08:00
1 parent 410f36f719
commit 981d754133
5 files changed
+24 -5

No files matched your search

+4
View File
@@ -213,6 +213,10 @@ func Auth(appBag map[string]any, users any, opts map[string]any) (map[string]any
if v := firstStr(opts, "default_role", "默认角色"); v != "" {
authBag["default_role"] = v
}
if v := firstStr(opts, "session_url", "会话地址", "redis_url", "Redis"); v != "" {
out["session_url"] = v
authBag["session_url"] = v
}
out["auth"] = authBag
gates := gatesOf(out)
if !hasAdminGate(gates, prefix) {