- New GET/POST handler at /api/auth/signout deletes the DB session and clears all NextAuth cookies (respecting NEXTAUTH_COOKIE_DOMAIN so the shared .internal.vyntehome.com cookies are properly evicted) - Added NEXTAUTH_COOKIE_DOMAIN to scheduler service env in docker-compose - Sign-out link in AppShell profile block so logout is accessible from the UI
52 lines
1.9 KiB
TypeScript
52 lines
1.9 KiB
TypeScript
import Link from "next/link";
|
|
|
|
type ActiveNavItem = "calendar" | "availability" | "connections";
|
|
type NavItem = { id: ActiveNavItem; href: string; label: string };
|
|
|
|
const navItems: NavItem[] = [
|
|
{ id: "calendar", href: "/calendar", label: "Calendar" },
|
|
{ id: "availability", href: "/availability", label: "Availability" },
|
|
{ id: "connections", href: "/connections", label: "Connections" },
|
|
];
|
|
|
|
export function AppShell({
|
|
active,
|
|
user,
|
|
children,
|
|
}: {
|
|
active: ActiveNavItem;
|
|
user: { name: string; timeZone: string };
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<div className="app-frame">
|
|
<aside className="sidebar">
|
|
<div className="brand">
|
|
<svg width="22" height="22" viewBox="0 0 32 32" aria-hidden="true" style={{ flexShrink: 0 }}>
|
|
<rect width="32" height="32" rx="7.5" fill="#0d0f11"/>
|
|
<rect x="6" y="7" width="4" height="4" rx="1" fill="#52b583" opacity="0.5"/>
|
|
<rect x="22" y="7" width="4" height="4" rx="1" fill="#52b583" opacity="0.5"/>
|
|
<line x1="8" y1="11" x2="16" y2="22.5" stroke="#52b583" strokeWidth="2.5" strokeLinecap="round"/>
|
|
<line x1="24" y1="11" x2="16" y2="22.5" stroke="#52b583" strokeWidth="2.5" strokeLinecap="round"/>
|
|
<circle cx="16" cy="22.5" r="2.5" fill="#52b583"/>
|
|
</svg>
|
|
Vynte Schedule
|
|
</div>
|
|
<nav className="nav-list" aria-label="Scheduler navigation">
|
|
{navItems.map((item) => (
|
|
<Link key={item.id} className="nav-item" data-active={item.id === active} href={item.href}>
|
|
{item.label}
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
<div className="profile-block">
|
|
<strong>{user.name}</strong>
|
|
<span>{user.timeZone}</span>
|
|
<a href="/api/auth/signout" className="signout-link">Sign out</a>
|
|
</div>
|
|
</aside>
|
|
<main className="main-surface">{children}</main>
|
|
</div>
|
|
);
|
|
}
|