fix(login): lru-cache compatibility, improve session error handling (#12099)

# Which Problems Are Solved

- Logo and heading overlap on login pages due to a -mb-4 negative margin
on the logo container
- The /login route returns a 500 when `listSessions` fails (e.g. stale
session cookies), because loadSessions has no error handling.
- The proxy logs `"fetch() returned undefined"` because
`fetchIframeOrigins` returns undefined, which lru-cache's forceFetch
treats as a fetch failure.

# How the Problems Are Solved

- Remove `-mb-4` from the logo container in DynamicTheme.
- Wrap `loadSessions` in a try/catch — failures fall through as empty
sessions instead of crashing.
- Return `null` instead of `undefined` from `fetchIframeOrigins` so
lru-cache caches it normally.

---------

Co-authored-by: Livio Spring <[email protected]>
Co-authored-by: conblem <[email protected]>
This commit is contained in:
Max Peintner
2026-04-30 15:27:44 +02:00
committed by GitHub
co-authored by Livio Spring conblem
parent 13f8ba4215
commit b1c8781516
12 changed files with 96 additions and 75 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ export function DynamicTheme({
<div className="relative mx-auto w-full max-w-[440px] px-4 py-4">
<Card>
<div className="mx-auto flex flex-col items-center space-y-8">
<div className="relative -mb-4 flex flex-row items-center justify-center">
<div className="relative flex flex-row items-center justify-center">
{branding && (
<Logo
lightSrc={branding.lightTheme?.logoUrl}
+1 -1
View File
@@ -51,7 +51,7 @@ export function RegisterForm({
mode: "onChange",
defaultValues: {
email: email ?? "",
firstName: firstname ?? "",
firstname: firstname ?? "",
lastname: lastname ?? "",
},
});