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 ( + + + + ); + }}