feat: add GET endpoint to retrieve contact requests with admin authentication
This commit is contained in:
@@ -5,7 +5,8 @@ import * as jose from 'jose';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const token = cookies().get('admin_token')?.value;
|
||||
const cookieStore = await cookies();
|
||||
const token = cookieStore.get('admin_token')?.value;
|
||||
if (!token) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user