fix: exclude /api/cron from auth middleware so cron jobs run unauthenticated

This commit is contained in:
2026-07-12 13:59:54 +08:00
parent 4242af029c
commit c1c874b3fe
+1 -1
View File
@@ -24,7 +24,7 @@ export async function middleware(request: NextRequest) {
const { data: { user } } = await supabase.auth.getUser()
const { pathname } = request.nextUrl
const isPublicRoute = pathname.startsWith('/login') || pathname.startsWith('/auth')
const isPublicRoute = pathname.startsWith('/login') || pathname.startsWith('/auth') || pathname.startsWith('/api/cron')
const isSharedRoute = pathname.startsWith('/report')
if (!user && !isPublicRoute) {