mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 22:32:04 +00:00
fix(api,ops): transactional adopt, admin gate without a flash, and a digest path to deploys
The self-context adopt runs read-modify-write inside one transaction, the admin shell renders nothing until the role is confirmed, and the json-body helper merges Headers instances correctly. The compose image reference accepts a pinned digest through an env var, and a promote script resolves the published digest, verifies its signature and hands the operator the exact pinning call — the documented path away from a moving latest tag.
This commit is contained in:
1 parent
599b7e8c99
commit
f13aa684f9
12 files changed
+876
-79
No files matched your search
@@ -39,6 +39,7 @@ import {
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { scrollBehaviorForUser } from "@/lib/motion";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
import { isAdminSectionSlug, type AdminSectionSlug } from "./section-slugs";
|
||||
|
||||
@@ -172,6 +173,7 @@ function deriveActiveSlug(
|
||||
export function AdminShell({ active, children }: AdminShellProps) {
|
||||
const pathname = usePathname();
|
||||
const { t } = useTranslations();
|
||||
const { user } = useAuth();
|
||||
const activeSlug = deriveActiveSlug(pathname, active);
|
||||
|
||||
// v1.4.34 IW-G — mirror the settings-shell auto-scroll pattern so
|
||||
@@ -199,6 +201,13 @@ export function AdminShell({ active, children }: AdminShellProps) {
|
||||
});
|
||||
}, [activeSlug]);
|
||||
|
||||
// The section bodies are already role-gated, but the shell frame
|
||||
// itself (the full section nav in two layouts) used to paint for a
|
||||
// non-admin during the frames between auth resolving and AuthShell's
|
||||
// redirect effect replacing the route. Render nothing — frame AND
|
||||
// children — until the role is confirmed ADMIN.
|
||||
if (!user || user.role !== "ADMIN") return null;
|
||||
|
||||
// v1.4.25 W8 — AuthShell wraps the page in `px-4 py-6 md:px-6`
|
||||
// already, so this inner shell only carries the wider max-width.
|
||||
// Previously the duplicate `px-4 py-6 md:px-6 md:py-8` here was
|
||||
|
||||
Reference in new issue
Block a user