Files
moemail/middleware.ts
beilunyang cc7e5003c5 feat: Init
2024-12-16 01:49:50 +08:00

21 lines
362 B
TypeScript

import { auth } from "@/lib/auth"
import { NextResponse } from "next/server"
export async function middleware() {
const session = await auth()
if (!session) {
return NextResponse.json(
{ error: "Unauthorized" },
{ status: 401 }
)
}
return NextResponse.next()
}
export const config = {
matcher: [
"/api/emails/:path*",
]
}