We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48b2690 commit 23950dcCopy full SHA for 23950dc
1 file changed
src/lib/server/auth.ts
@@ -73,7 +73,9 @@ async function initiateScriptoriaLogin(event: RequestEvent) {
73
export function returnTo(event: RequestEvent) {
74
let redirectUrl = decodeURIComponent(event.url.searchParams.get('returnTo') ?? '');
75
while (redirectUrl?.startsWith('/login')) {
76
- redirectUrl = decodeURIComponent(new URL(redirectUrl).searchParams.get('returnTo') ?? '');
+ redirectUrl = decodeURIComponent(
77
+ new URL(secrets.ORIGIN, redirectUrl).searchParams.get('returnTo') ?? ''
78
+ );
79
}
80
throw redirect(
81
302,
0 commit comments