mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-02 08:06:38 +08:00
fix auth
This commit is contained in:
parent
20871f7e50
commit
ea652d5f33
@ -1,17 +1,10 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import prisma from "@/lib/prisma";
|
||||
import { VerifiedAdminUser } from "@/lib/auth";
|
||||
|
||||
async function handle(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { path: string[] } },
|
||||
) {
|
||||
// 认证,管理员权限
|
||||
const isAdmin = await VerifiedAdminUser();
|
||||
if (isAdmin) {
|
||||
return NextResponse.json({ error: "无权限" }, { status: 401 });
|
||||
}
|
||||
|
||||
// 判断网址和请求方法
|
||||
const method = req.method;
|
||||
// const url = req.url;
|
||||
|
Loading…
Reference in New Issue
Block a user