fix(login): respect branding themeMode for theme toggle, fix CSP (#11903)

Closes #11721

# Which Problems Are Solved

The login app now correctly handles the themeMode from branding
settings:

- Hide toggle when themeMode is LIGHT or DARK — the theme is forced,
users cannot switch
- Show 3-option toggle (light / system / dark) when themeMode is AUTO or
UNSPECIFIED

# How the Problems Are Solved

- Introduced a `BrandingContext` to pass `themeMode` from `ThemeWrapper`
down to `ThemeSwitch`

# Additional Changes

- removed the CSP from next.config.ts to prevent a precedency issue
where the CSP was actually not applied
This commit is contained in:
Max Peintner
2026-03-31 12:25:09 +00:00
committed by GitHub
parent 604d5cb0a9
commit ec0bd5790f
5 changed files with 141 additions and 51 deletions
-5
View File
@@ -1,5 +1,4 @@
import createNextIntlPlugin from "next-intl/plugin";
import { DEFAULT_CSP } from "./constants/csp.js";
const withNextIntl = createNextIntlPlugin();
@@ -20,10 +19,6 @@ const secureHeaders = [
key: "X-XSS-Protection",
value: "1; mode=block",
},
{
key: "Content-Security-Policy",
value: DEFAULT_CSP,
},
{ key: "X-Frame-Options", value: "deny" },
];