Login: change url for redirect

This commit is contained in:
Darya Umrikhina 2024-06-27 14:47:31 +07:00
parent 6023a92ea0
commit 3aa76c87f0

View File

@ -39,11 +39,10 @@ export function middleware(request: NextRequest) {
return NextResponse.json({ status: "healthy" }, { status: 200 });
}
console.log(request.nextUrl.pathname);
if (request.nextUrl.pathname.includes("confirm")) {
console.log("call" );
return NextResponse.rewrite(`/login/${request.nextUrl.pathname}`);
return NextResponse.rewrite(
`${request.nextUrl.origin}/login${request.nextUrl.pathname}`,
);
}
const isAuth = !!request.cookies.get("asc_auth_key")?.value;