feat: add full-stack API persistence and RBAC

This commit is contained in:
2026-07-01 06:28:18 -07:00
parent aafd9caaac
commit 914f74c5cc
18 changed files with 1148 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { removeCurrentSession } from "@/modules/core/server/auth";
import { jsonSuccess } from "@/modules/core/server/api";
import { recordAuditLog } from "@/modules/core/server/audit";
export async function POST(): Promise<Response> {
const account = await removeCurrentSession();
if (account) {
await recordAuditLog({
actor: account,
action: "auth.logout",
targetType: "session",
result: "success",
reason: "退出登录",
});
}
return jsonSuccess("已退出登录", {});
}