fix(admin): preserve revoked owners and 503 status
Owner recovery lived in the identity-only migration path and could clear historical revocations on conflict. Admin layout also rethrew authorization 503s, turning service-unavailable failures into 500 responses.\n\nMove recovery behind the RBAC migration sequence, exclude revoked candidates without mutating their history, and terminate layout redirects at a no-store 503 route.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
export function GET() {
|
||||
return new Response("后台服务暂时不可用", {
|
||||
status: 503,
|
||||
headers: {
|
||||
"cache-control": "no-store",
|
||||
"content-type": "text/plain; charset=utf-8",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -17,6 +17,7 @@ export default async function AdminLayout({ children }: { children: ReactNode })
|
||||
const failure = resolveAdminPageAccessFailure(error.status);
|
||||
if (failure.kind === "login") redirect(failure.location);
|
||||
if (failure.kind === "forbidden") forbidden();
|
||||
if (failure.kind === "unavailable") redirect(failure.location);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user