mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 09:46:39 +02:00
🔍️ Only set callback url if not root
This commit is contained in:
parent
af6f7b6140
commit
a39f64eab9
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
Reference in a new issue