feat: rewrite frontend auth — roles from org store, Logto org role names

Replace ID-token claim reads with org store lookups in useAuth and
usePermissions; add currentOrgRoles to useOrgStore; update role names
to Logto org role conventions (admin/member); remove username from
Layout (no longer derived from token claims).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-05 12:42:26 +02:00
parent 5f43394b00
commit ec1ec2e65f
4 changed files with 19 additions and 38 deletions

View File

@@ -100,7 +100,7 @@ function PlatformIcon() {
export function Layout() {
const navigate = useNavigate();
const { username, logout, isPlatformAdmin } = useAuth();
const { logout, isPlatformAdmin } = useAuth();
const [envSectionOpen, setEnvSectionOpen] = useState(true);
const [collapsed, setCollapsed] = useState(false);
@@ -166,7 +166,7 @@ export function Layout() {
{/* User info + logout */}
<Sidebar.FooterLink
icon={<UserIcon />}
label={username ?? 'Account'}
label="Account"
onClick={logout}
/>
</Sidebar.Footer>
@@ -177,7 +177,7 @@ export function Layout() {
<AppShell sidebar={sidebar}>
<TopBar
breadcrumb={[]}
user={username ? { name: username } : undefined}
user={undefined}
onLogout={logout}
/>
<Outlet />