From 5f14f3c3f5579fec83be04f10ae500d5480b341c Mon Sep 17 00:00:00 2001 From: Gareth Date: Sun, 21 Dec 2025 14:30:06 -0800 Subject: [PATCH] fix: prevent renaming users after creation, remove and readd instead --- webui/src/views/SettingsModal.tsx | 56 ++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/webui/src/views/SettingsModal.tsx b/webui/src/views/SettingsModal.tsx index c753deaf..adf02abf 100644 --- a/webui/src/views/SettingsModal.tsx +++ b/webui/src/views/SettingsModal.tsx @@ -40,6 +40,7 @@ interface FormData { name: string; passwordBcrypt: string; needsBcrypt?: boolean; + isExisting?: boolean; }[]; }; instance: string; @@ -257,9 +258,10 @@ const AuthenticationForm: React.FC<{ - toJson(UserSchema, u, { alwaysEmitImplicit: true }) - ) || [] + config.auth?.users?.map((u) => ({ + ...(toJson(UserSchema, u, { alwaysEmitImplicit: true }) as any), + isExisting: true, + })) || [] } > {(fields, { add, remove }) => ( @@ -269,20 +271,42 @@ const AuthenticationForm: React.FC<{ + + {(form) => { + const isExisting = form.getFieldValue([ + "auth", + "users", + field.name, + "isExisting", + ]); + return ( + + + + ); + }}