good forst commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { getApiBaseUrl, jsonResponse } from '../../../../../_lib/api';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET(_req: Request, { params }: { params: Promise<{ token: string }> }): Promise<Response> {
|
||||
const { token } = await params;
|
||||
const tokenCookie = await (await import('next/headers')).cookies().then(c => c.get('tower_super_token')?.value);
|
||||
const res = await fetch(`${getApiBaseUrl()}/admin/bots/qr/${token}`, {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
...(tokenCookie ? { Authorization: `Bearer ${tokenCookie}` } : {}),
|
||||
},
|
||||
cache: 'no-store',
|
||||
});
|
||||
const body = await res.json();
|
||||
return jsonResponse(body, res.status);
|
||||
}
|
||||
Reference in New Issue
Block a user