feat: establish NekoNest Cloud control and relay
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { getCloudViewer } from "@/app/cloud-auth";
|
||||
import { DomainError } from "@/db/repository";
|
||||
import { apiError, readJsonMutation } from "../../respond";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const viewer = await getCloudViewer();
|
||||
if (!viewer) return Response.json({ error: "authentication_required", message: "请先登录" }, { status: 401 });
|
||||
if (!viewer.isAdmin) return Response.json({ error: "forbidden", message: "没有商业后台权限" }, { status: 403 });
|
||||
await readJsonMutation<{ period?: "month" | "year"; amountMinor?: number; reason?: string; idempotencyKey?: string }>(request);
|
||||
throw new DomainError("paid_features_deferred", "免费公测阶段不发布价格版本", 409);
|
||||
} catch (error) { return apiError(error); }
|
||||
}
|
||||
Reference in New Issue
Block a user