From 5f797628ac890f519d6ef3c148544a3cfa0a79e5 Mon Sep 17 00:00:00 2001 From: LukeGus Date: Tue, 2 Sep 2025 16:56:28 -0500 Subject: [PATCH] Fix spelling error --- src/ui/Admin/AdminSettings.tsx | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/ui/Admin/AdminSettings.tsx b/src/ui/Admin/AdminSettings.tsx index bece9c0a..ee375929 100644 --- a/src/ui/Admin/AdminSettings.tsx +++ b/src/ui/Admin/AdminSettings.tsx @@ -52,7 +52,8 @@ export function AdminSettings({isTopbarOpen = true}: AdminSettingsProps): React. token_url: '', identifier_path: 'sub', name_path: 'name', - scopes: 'openid email profile' + scopes: 'openid email profile', + userinfo_url: '' }); const [oidcLoading, setOidcLoading] = React.useState(false); const [oidcError, setOidcError] = React.useState(null); @@ -145,7 +146,7 @@ export function AdminSettings({isTopbarOpen = true}: AdminSettingsProps): React. setOidcConfig(prev => ({...prev, [field]: value})); }; - const makeUserAdmin = async (e: React.FormEvent) => { + const handleMakeUserAdmin = async (e: React.FormEvent) => { e.preventDefault(); if (!newAdminUsername.trim()) return; setMakeAdminLoading(true); @@ -164,23 +165,25 @@ export function AdminSettings({isTopbarOpen = true}: AdminSettingsProps): React. } }; - const removeAdminStatus = async (username: string) => { + const handleRemoveAdminStatus = async (username: string) => { if (!confirm(`Remove admin status from ${username}?`)) return; const jwt = getCookie("jwt"); try { await removeAdminStatus(username); fetchUsers(); - } catch { + } catch (err: any) { + console.error('Failed to remove admin status:', err); } }; - const deleteUser = async (username: string) => { + const handleDeleteUser = async (username: string) => { if (!confirm(`Delete user ${username}? This cannot be undone.`)) return; const jwt = getCookie("jwt"); try { await deleteUser(username); fetchUsers(); - } catch { + } catch (err: any) { + console.error('Failed to delete user:', err); } }; @@ -296,9 +299,15 @@ export function AdminSettings({isTopbarOpen = true}: AdminSettingsProps): React.
handleOIDCConfigChange('scopes', (e.target as HTMLInputElement).value)} + onChange={(e) => handleOIDCConfigChange('scopes', e.target.value)} placeholder="openid email profile" required/>
+
+ + handleOIDCConfigChange('userinfo_url', e.target.value)} + placeholder="https://your-provider.com/application/o/userinfo/"/> +
@@ -310,7 +319,8 @@ export function AdminSettings({isTopbarOpen = true}: AdminSettingsProps): React. token_url: '', identifier_path: 'sub', name_path: 'name', - scopes: 'openid email profile' + scopes: 'openid email profile', + userinfo_url: '' })}>Reset
@@ -357,7 +367,7 @@ export function AdminSettings({isTopbarOpen = true}: AdminSettingsProps): React. className="px-4">{user.is_oidc ? "External" : "Local"}