Skip to content

Commit

Permalink
Formatter
Browse files Browse the repository at this point in the history
Quickfix
  • Loading branch information
monsieurswag committed Dec 3, 2024
1 parent a8b25bd commit eaee0b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '';
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/(authentication)/login/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down

0 comments on commit eaee0b5

Please sign in to comment.