diff --git a/src/components/navigation/AppSidebar.tsx b/src/components/navigation/AppSidebar.tsx
index 0ba10a0..714830f 100644
--- a/src/components/navigation/AppSidebar.tsx
+++ b/src/components/navigation/AppSidebar.tsx
@@ -13,6 +13,7 @@ import {
ScrollText,
Terminal,
ShieldCheck,
+ Key,
} from "lucide-react";
import { GatehouseLogo } from "@/components/branding/GatehouseLogo";
import { NavLink } from "@/components/NavLink";
@@ -57,8 +58,9 @@ const orgAdminNavItems = [
const adminNavItems = [
{ title: "Certificate Auth.", url: "/org/cas", icon: ShieldCheck },
- { title: "Org Audit Log", url: "/org/audit", icon: FileText },
- { title: "System Logs", url: "/admin/audit", icon: ScrollText },
+ { title: "OIDC Clients", url: "/org/clients", icon: Key },
+ { title: "Org Audit Log", url: "/org/audit", icon: FileText },
+ { title: "System Logs", url: "/admin/audit", icon: ScrollText },
];
export function AppSidebar() {
diff --git a/src/components/security/TotpRemoveDialog.tsx b/src/components/security/TotpRemoveDialog.tsx
index 69098d2..14ce0aa 100644
--- a/src/components/security/TotpRemoveDialog.tsx
+++ b/src/components/security/TotpRemoveDialog.tsx
@@ -18,6 +18,7 @@ interface TotpRemoveDialogProps {
onOpenChange: (open: boolean) => void;
onSuccess: () => void;
isRequired?: boolean;
+ hasPassword?: boolean;
}
export function TotpRemoveDialog({
@@ -25,6 +26,7 @@ export function TotpRemoveDialog({
onOpenChange,
onSuccess,
isRequired = false,
+ hasPassword = true,
}: TotpRemoveDialogProps) {
const [isLoading, setIsLoading] = useState(false);
const [password, setPassword] = useState("");
@@ -45,7 +47,7 @@ export function TotpRemoveDialog({
};
const handleRemove = async () => {
- if (!password) {
+ if (hasPassword && !password) {
setError("Password is required to disable TOTP");
return;
}
@@ -54,7 +56,7 @@ export function TotpRemoveDialog({
setError(null);
try {
- await api.totp.disable(password);
+ await api.totp.disable(hasPassword ? password : null);
toast({
title: "Two-factor authentication disabled",
@@ -80,7 +82,7 @@ export function TotpRemoveDialog({
};
const handleKeyDown = (e: React.KeyboardEvent) => {
- if (e.key === "Enter" && password) {
+ if (e.key === "Enter" && (!hasPassword || password)) {
handleRemove();
}
};
@@ -109,25 +111,30 @@ export function TotpRemoveDialog({
-
-
-
{
- setPassword(e.target.value);
- setError(null);
- }}
- onKeyDown={handleKeyDown}
- disabled={isLoading}
- autoFocus
- />
- {error && (
-
{error}
- )}
-
+ {hasPassword && (
+
+
+
{
+ setPassword(e.target.value);
+ setError(null);
+ }}
+ onKeyDown={handleKeyDown}
+ disabled={isLoading}
+ autoFocus
+ />
+ {error && (
+
{error}
+ )}
+
+ )}
+ {!hasPassword && error && (
+
{error}
+ )}