feat: /api/config endpoint can be called using APIKey

This commit is contained in:
beilunyang
2025-05-13 00:01:15 +08:00
parent fa1dadfb21
commit eb6c3fe5eb
3 changed files with 16 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ async function getUserByApiKey(key: string): Promise<User | null> {
}
export async function handleApiKeyAuth(apiKey: string, pathname: string) {
if (!pathname.startsWith('/api/emails')) {
if (!pathname.startsWith('/api/emails') && !pathname.startsWith('/api/config')) {
return NextResponse.json(
{ error: "无权限查看" },
{ status: 403 }