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:
Jesse_Chen
2026-08-07 11:33:48 +08:00
parent 0d7e5a26d5
commit 754505d40a
7 changed files with 95 additions and 15 deletions
+1
View File
@@ -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;
}