fix: exclude /api/cron from auth middleware so cron jobs run unauthenticated
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ export async function middleware(request: NextRequest) {
|
|||||||
|
|
||||||
const { data: { user } } = await supabase.auth.getUser()
|
const { data: { user } } = await supabase.auth.getUser()
|
||||||
const { pathname } = request.nextUrl
|
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')
|
const isSharedRoute = pathname.startsWith('/report')
|
||||||
|
|
||||||
if (!user && !isPublicRoute) {
|
if (!user && !isPublicRoute) {
|
||||||
|
|||||||
Reference in New Issue
Block a user