From 49d0310ecc08040b6c6fa4f402584543d679e2e8 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 16 Sep 2026 12:03:32 +0200 Subject: [PATCH] fix(apps): re-check access in place after a password sign-in (#11166) * fix(apps): re-check access in place after a password sign-in Co-Authored-By: Claude Opus 5 (1M context) * style: drop redundant comment in the password sign-in hand-back Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- frontend/src/lib/components/Login.svelte | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/lib/components/Login.svelte b/frontend/src/lib/components/Login.svelte index da032717f6..44ba7e4e15 100644 --- a/frontend/src/lib/components/Login.svelte +++ b/frontend/src/lib/components/Login.svelte @@ -61,6 +61,10 @@ popup?: boolean firstTime?: boolean autoRedirect?: boolean + /** Supplying this replaces the post-login redirect: the card hands back instead of + * navigating, and the host is expected to re-check access in place. For a gate on a + * page that stays mounted, `rd` is the URL already shown, so navigating there would + * re-run nothing. */ onLoginSuccess?: () => void /** A refusal the popup relayed back, in the server's words. */ onLoginError?: (message: string) => void @@ -290,6 +294,11 @@ // Finally, we check whether the user is a superadmin refreshSuperadmin() + + if (onLoginSuccess) { + onLoginSuccess() + return + } redirectUser() }