Skip to content

Commit

Permalink
Don't use '/' as ReturnTo URL
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Nov 22, 2024
1 parent c9d390c commit 6deb838
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export const handle: Handle = ({ event, resolve }) => {
return resolve(event, options);
} else if (!isAuthn(cookies)) {
const relativePath = event.url.href.substring(event.url.origin.length);
redirect(307, `/login?ReturnUrl=${encodeURIComponent(relativePath)}`);
if (relativePath !== '/')
redirect(307, `/login?ReturnUrl=${encodeURIComponent(relativePath)}`);
else
redirect(307, '/login');
}
//when at home
if (routeId == `/${AUTHENTICATED_ROOT}`) {
Expand Down

0 comments on commit 6deb838

Please sign in to comment.