mirror of
https://github.com/handsomezhuzhu/QQuiz.git
synced 2026-04-18 22:42:53 +00:00
完善文档与前端迁移,补充开源协议
This commit is contained in:
17
web/src/app/api/auth/logout/route.ts
Normal file
17
web/src/app/api/auth/logout/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import { SESSION_COOKIE_NAME } from "@/lib/api/config";
|
||||
|
||||
async function clearSession() {
|
||||
cookies().delete(SESSION_COOKIE_NAME);
|
||||
return NextResponse.json({ ok: true });
|
||||
}
|
||||
|
||||
export async function POST() {
|
||||
return clearSession();
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
return clearSession();
|
||||
}
|
||||
Reference in New Issue
Block a user