@@ -0,0 +1,16 @@
|
||||
// server/api/auth/register-open.get.ts - 公开接口:查询当前是否开放注册
|
||||
//
|
||||
// 该接口无需登录,供前端注册页面展示禁用提示使用。
|
||||
// 路径位于 /api/auth/** 公开区内,不经过鉴权中间件。
|
||||
// 不返回任何用户数据或系统敏感信息。
|
||||
|
||||
import { apiOk } from "~~/server/utils/response";
|
||||
import { getSysConfig } from "~~/server/utils/sysConfig";
|
||||
import type { IRegisterStatusResponse } from "~~/shared/types/settings";
|
||||
|
||||
export default defineEventHandler(
|
||||
async (): Promise<IRegisterStatusResponse> => {
|
||||
const cfg = await getSysConfig();
|
||||
return apiOk({ allowRegistration: cfg.allowRegistration });
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user