(request: NextRequest, pathname: string, status = 307, search = '')
| 2 | import { getWebAuthConfig, isAuthenticatedCookie } from '@/lib/server/auth'; |
| 3 | |
| 4 | function redirectTo(request: NextRequest, pathname: string, status = 307, search = '') { |
| 5 | const normalizedPath = pathname.startsWith('/') ? pathname : `/${pathname}`; |
| 6 | const location = new URL(`${normalizedPath}${search}`, request.url); |
| 7 | return NextResponse.redirect(location, status); |
| 8 | } |
| 9 | |
| 10 | function isPublicPath(pathname: string) { |
| 11 | return pathname === '/login' |