mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-10 03:27:59 +00:00
13 lines
342 B
TypeScript
13 lines
342 B
TypeScript
import { NextResponse, type NextRequest } from 'next/server';
|
|
|
|
export function middleware(request: NextRequest) {
|
|
const token = request.headers.get('Authorization');
|
|
if (!token) {
|
|
return NextResponse.redirect(new URL('/login', request.url));
|
|
}
|
|
return NextResponse.next();
|
|
}
|
|
|
|
export const config = {
|
|
matcher: ['/api/:path*'],
|
|
};
|