mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-22 21:38:05 -05:00
16 lines
418 B
TypeScript
16 lines
418 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import { getSessionCookie } from 'better-auth'
|
|
|
|
export async function middleware(request: NextRequest) {
|
|
const sessionCookie = getSessionCookie(request)
|
|
if (!sessionCookie) {
|
|
return NextResponse.redirect(new URL('/login', request.url))
|
|
}
|
|
return NextResponse.next()
|
|
}
|
|
|
|
// TODO: Add protected routes
|
|
export const config = {
|
|
matcher: ['/w/:path*'],
|
|
}
|