Skip to content

Commit 3210e11

Browse files
Revert "fix(app-router): encode returnTo in login redirect to prevent OAuth param injection" (#2443)
2 parents 1485b55 + 4c72110 commit 3210e11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/helpers/with-page-auth-required.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const appRouteHandlerFactory =
196196
: opts.returnTo;
197197
const { redirect } = await import("next/navigation.js");
198198
redirect(
199-
`${config.loginUrl}${returnTo ? `?returnTo=${encodeURIComponent(returnTo)}` : ""}`
199+
`${config.loginUrl}${opts.returnTo ? `?returnTo=${returnTo}` : ""}`
200200
);
201201
}
202202
return handler(params);

0 commit comments

Comments
 (0)