2025-08-01 15:41:44 +08:00

26 lines
645 B
TypeScript

import { NextRequest, NextResponse } from 'next/server';
import { authenticateRequest } from '@/lib/auth';
export async function GET(request: NextRequest) {
try {
const auth = await authenticateRequest(request);
if (!auth.success) {
return NextResponse.json(
{ success: false, error: auth.error },
{ status: 401 }
);
}
return NextResponse.json({
success: true,
message: 'Authenticated',
});
} catch (error) {
console.error('Auth check error:', error);
return NextResponse.json(
{ success: false, error: 'Internal server error' },
{ status: 500 }
);
}
}