(request: NextRequest)
| 2 | import { getSessionCookie } from "better-auth/cookies"; |
| 3 | |
| 4 | export async function middleware(request: NextRequest) { |
| 5 | const sessionCookie = getSessionCookie(request); |
| 6 | |
| 7 | if (!sessionCookie) { |
| 8 | return NextResponse.redirect(new URL("/sign-in", request.url)); |
| 9 | } |
| 10 | |
| 11 | return NextResponse.next(); |
| 12 | } |
| 13 | |
| 14 | export const config = { |
| 15 | matcher: ["/dashboard"], // Apply middleware to specific routes |
nothing calls this directly
no outgoing calls
no test coverage detected