fix basic auth
This commit is contained in:
+2
-1
@@ -5,7 +5,7 @@ export function withAuth(handler: (req: NextRequest) => Promise<NextResponse>) {
|
||||
return async (req: NextRequest) => {
|
||||
const url = new URL(req.url)
|
||||
|
||||
// Skip auth for certain paths
|
||||
// Skip auth for certain paths (same logic as original Express app)
|
||||
if (
|
||||
url.pathname.startsWith('/api/') ||
|
||||
url.pathname.startsWith('/screenshots/') ||
|
||||
@@ -17,6 +17,7 @@ export function withAuth(handler: (req: NextRequest) => Promise<NextResponse>) {
|
||||
return handler(req)
|
||||
}
|
||||
|
||||
// For all other paths, require authentication
|
||||
const authHeader = req.headers.get('authorization')
|
||||
|
||||
if (!authHeader) {
|
||||
|
||||
Reference in New Issue
Block a user