fix(frontend): hide logout outside local auth

This commit is contained in:
User
2026-08-22 19:43:42 +02:00
parent 309bc44d4a
commit 9c47fb5f3d
7 changed files with 92 additions and 15 deletions
+10 -2
View File
@@ -36,7 +36,11 @@ import { useEffect, useMemo, useRef, useState } from "react";
import type { CSSProperties } from "react";
import { captureAuthOperation, isAuthOperationCurrent, StaleAuthOperationError, type AuthOperationGuard } from "../auth/authOperation";
export function AppShell() {
interface AppShellProps {
canLogout: boolean;
}
export function AppShell({ canLogout }: AppShellProps) {
const authenticatedUser = useAuthUser();
const [panelSession, setPanelSession] = useState<SessionSummary | null>(null);
const {
@@ -717,7 +721,11 @@ export function AppShell() {
<span className="min-w-0 truncate text-xs text-muted-foreground" title={authenticatedUser.displayName ?? authenticatedUser.subject}>
{authenticatedUser.displayName ?? authenticatedUser.subject}
</span>
<Button variant="ghost" size="xs" onClick={() => { void signOut().catch(() => undefined); }}>Log out</Button>
{canLogout && (
<Button variant="ghost" size="xs" onClick={() => { void signOut().catch(() => undefined); }}>
Log out
</Button>
)}
</div>
)}
</div>