mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-31 09:46:26 +02:00
🔍️ Only set callback url if not root (#1521)
This commit is contained in:
parent
4907576a3e
commit
c7e4fcb4ec
1 changed files with 3 additions and 1 deletions
|
@ -39,7 +39,9 @@ export const middleware = withAuth(
|
|||
!isLoggedIn &&
|
||||
!publicRoutes.some((route) => newUrl.pathname.startsWith(route))
|
||||
) {
|
||||
newUrl.searchParams.set("callbackUrl", newUrl.pathname);
|
||||
if (newUrl.pathname !== "/") {
|
||||
newUrl.searchParams.set("callbackUrl", newUrl.pathname);
|
||||
}
|
||||
newUrl.pathname = "/login";
|
||||
return NextResponse.redirect(newUrl);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue