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:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user