ops 订阅开通改为 Next.js 直连 Supabase,免去 VPS 鉴权链路
This commit is contained in:
@@ -25,6 +25,18 @@ export function runTests() {
|
||||
path.join(projectRoot, "app", "api", "analytics", "events", "route.ts"),
|
||||
"utf8",
|
||||
);
|
||||
const grantRouteSource = fs.readFileSync(
|
||||
path.join(
|
||||
projectRoot,
|
||||
"app",
|
||||
"api",
|
||||
"ops",
|
||||
"subscriptions",
|
||||
"grant",
|
||||
"route.ts",
|
||||
),
|
||||
"utf8",
|
||||
);
|
||||
const subscriptionsPageSource = fs.readFileSync(
|
||||
path.join(
|
||||
projectRoot,
|
||||
@@ -84,4 +96,10 @@ export function runTests() {
|
||||
subscriptionsPageSource.includes("/api/ops/subscriptions/extend"),
|
||||
"ops manual subscription grant/extend must send the Supabase bearer token to avoid 401 when route cookies are stale",
|
||||
);
|
||||
assert(
|
||||
grantRouteSource.includes("grantSubscriptionDirectly") &&
|
||||
grantRouteSource.includes("res.status === 404") &&
|
||||
grantRouteSource.includes('"status": "active"'),
|
||||
"ops subscription grant route must fall back to direct Supabase grant when the VPS backend route is missing",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user