Add SMTP password field.

Added a password field to the Mail Settings tab in the General Settings panel, ensuring it is saved and retrieved via the `/api/settings` endpoint.
This commit is contained in:
Tola Leng
2025-06-05 18:33:58 +08:00
parent 0739d6b0ce
commit 4ef84b5469
3 changed files with 24 additions and 0 deletions
@@ -47,6 +47,7 @@ const GeneralSettingsPanel: React.FC<GeneralSettingsPanelProps> = () => {
port: 587,
host: '',
username: '',
password: '',
authMethod: '',
tls: true,
localName: ''
@@ -73,6 +74,7 @@ const GeneralSettingsPanel: React.FC<GeneralSettingsPanelProps> = () => {
port: 587,
host: '',
username: '',
password: '',
authMethod: '',
tls: true,
localName: ''
@@ -131,6 +133,7 @@ const GeneralSettingsPanel: React.FC<GeneralSettingsPanelProps> = () => {
port: 587,
host: '',
username: '',
password: '',
authMethod: '',
tls: true,
localName: ''
@@ -140,6 +140,26 @@ const MailSettingsTab: React.FC<MailSettingsTabProps> = ({
/>
</div>
<div className="mt-4">
<FormField
control={form.control}
name="smtp.password"
render={({ field }) => (
<FormItem>
<FormLabel>{t("smtpPassword", "settings")}</FormLabel>
<FormControl>
<Input
{...field}
type="password"
disabled={!isEditing || !form.watch('smtp.enabled')}
placeholder="••••••••"
/>
</FormControl>
</FormItem>
)}
/>
</div>
<div className="mt-4">
<FormField
control={form.control}