From eaee0b556616269582ff7121a065fd3260beab92 Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Tue, 3 Dec 2024 09:05:17 +0100 Subject: [PATCH] Formatter Quickfix --- frontend/src/lib/utils/helpers.ts | 2 +- frontend/src/routes/(authentication)/login/+page.server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/utils/helpers.ts b/frontend/src/lib/utils/helpers.ts index b0d5b91aa1..57a1344842 100644 --- a/frontend/src/lib/utils/helpers.ts +++ b/frontend/src/lib/utils/helpers.ts @@ -60,7 +60,7 @@ export function formatScoreValue(value: number, max_score: number, fullDonut = f } export function getSecureRedirect(url: any): string { - const SECURE_REDIRECT_URL_REGEX = /^\/\w*/; + const SECURE_REDIRECT_URL_REGEX = /^\/\w+/; return typeof url === 'string' && SECURE_REDIRECT_URL_REGEX.test(url) ? url : ''; } diff --git a/frontend/src/routes/(authentication)/login/+page.server.ts b/frontend/src/routes/(authentication)/login/+page.server.ts index 8a6f4f45f2..31f5013dcf 100644 --- a/frontend/src/routes/(authentication)/login/+page.server.ts +++ b/frontend/src/routes/(authentication)/login/+page.server.ts @@ -133,7 +133,7 @@ export const actions: Actions = { const next = url.searchParams.get('next') || '/'; const secureNext = getSecureRedirect(next); - const refreshQueryParam = (CI_TEST ? '' : '?refresh=1'); + const refreshQueryParam = CI_TEST ? '' : '?refresh=1'; const redirectURL = secureNext ? `${secureNext}${refreshQueryParam}` : `/${refreshQueryParam}`; redirect(302, redirectURL); },