From a8b25bd4b7170062db6524b6ab3051a236ccd7ba Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Tue, 3 Dec 2024 09:04:09 +0100 Subject: [PATCH] Fix broken getSecureRedirect --- frontend/src/routes/(authentication)/login/+page.server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/(authentication)/login/+page.server.ts b/frontend/src/routes/(authentication)/login/+page.server.ts index ff4549dd4..8a6f4f45f 100644 --- a/frontend/src/routes/(authentication)/login/+page.server.ts +++ b/frontend/src/routes/(authentication)/login/+page.server.ts @@ -132,7 +132,9 @@ export const actions: Actions = { } const next = url.searchParams.get('next') || '/'; - const redirectURL = getSecureRedirect(next) + (CI_TEST ? '' : '?refresh=1'); + const secureNext = getSecureRedirect(next); + const refreshQueryParam = (CI_TEST ? '' : '?refresh=1'); + const redirectURL = secureNext ? `${secureNext}${refreshQueryParam}` : `/${refreshQueryParam}`; redirect(302, redirectURL); }, mfaAuthenticate: async (event) => {