Skip to content

Commit

Permalink
Update redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevella committed Feb 7, 2025
1 parent 3dcbd49 commit dfbe501
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/web/src/next-auth.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const nextAuthConfig = {
}
const redirectUrl = new URL("/login", request.url);
if (nextUrl.pathname !== "/") {
redirectUrl.searchParams.set("redirectTo", nextUrl.href);
const redirectPath = nextUrl.pathname + nextUrl.search;
redirectUrl.searchParams.set("redirectTo", redirectPath);
}
return NextResponse.redirect(redirectUrl);
},
Expand Down

0 comments on commit dfbe501

Please sign in to comment.