chore: trace security.ts log
This commit is contained in:
@@ -98,6 +98,8 @@ export const verifyApiKey = (app: Elysia) => app.onBeforeHandle((ctx) => {
|
|||||||
|
|
||||||
// 验证token
|
// 验证token
|
||||||
if (token !== process.env.ADMIN_API_KEY) {
|
if (token !== process.env.ADMIN_API_KEY) {
|
||||||
|
// 记录失败日志
|
||||||
|
console.warn(`Failed API key verification for token: <${token}>`);
|
||||||
return new Response('Forbidden', { status: 403 });
|
return new Response('Forbidden', { status: 403 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user