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
+17
View File
@@ -47,6 +47,23 @@ export async function GET(req: NextRequest) {
} finally {
clearTimeout(timeoutId);
}
if ((res.status === 401 || res.status === 403) && auth.authUserId) {
const response = NextResponse.json({
authenticated: true,
user_id: auth.authUserId,
email: auth.authEmail || null,
subscription_active: null,
subscription_plan_code: null,
subscription_expires_at: null,
subscription_total_expires_at: null,
subscription_queued_days: 0,
subscription_queued_count: 0,
points: 0,
degraded_auth_profile: true,
degraded_reason: `backend_${res.status}`,
});
return applyAuthResponseCookies(response, auth.response);
}
if (res.status === 401 || res.status === 403) {
const response = NextResponse.json({
authenticated: false,