fix: preserve terminal access during auth sync

This commit is contained in:
2569718930@qq.com
2026-05-28 12:18:43 +08:00
parent eef611adb4
commit 784b27a954
5 changed files with 194 additions and 65 deletions
@@ -88,6 +88,10 @@ export function runTests() {
),
"utf8",
);
const authMeRouteSource = fs.readFileSync(
path.join(projectRoot, "app", "api", "auth", "me", "route.ts"),
"utf8",
);
const subscriptionsPageSource = fs.readFileSync(
path.join(
projectRoot,
@@ -167,4 +171,10 @@ export function runTests() {
grantRouteSource.includes('"status": "active"'),
"ops subscription grant route must fall back to direct Supabase grant when the VPS backend route is missing",
);
assert(
authMeRouteSource.includes("if ((res.status === 401 || res.status === 403) && auth.authUserId)") &&
authMeRouteSource.includes("degraded_reason: `backend_${res.status}`") &&
authMeRouteSource.includes("subscription_active: null"),
"auth profile proxy must preserve authenticated identity with unknown subscription on backend 401/403 instead of forcing a false paywall",
);
}