feat: add GET endpoint to retrieve contact requests with admin authentication
This commit is contained in:
parent
9394b58b0e
commit
e1599650f0
@ -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 });
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user