mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-03 21:02:15 +00:00
fix: add port to SMTP host label (#4980)
* fix: add port to SMTP host label * fix gRPC request message * fix: validate port in backend * make defaults.yaml host field more clear * add placeholder smtp host field * make ipv6 smtp host valid * hide smtp password input * fix smtp host not filled * dont let browsers prefill smtp password
This commit is contained in:
+3
-3
@@ -27,9 +27,9 @@
|
||||
{{ 'SETTING.SMTP.TLS' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
<cnsl-form-field class="smtp-form-field" label="Host" required="true">
|
||||
<cnsl-label>{{ 'SETTING.SMTP.HOST' | translate }}</cnsl-label>
|
||||
<input cnslInput name="host" formControlName="host" />
|
||||
<cnsl-form-field class="smtp-form-field" label="Host And Port" required="true">
|
||||
<cnsl-label>{{ 'SETTING.SMTP.HOSTANDPORT' | translate }}</cnsl-label>
|
||||
<input cnslInput name="hostAndPort" formControlName="hostAndPort" placeholder="smtp.mailtrap.io:2525" />
|
||||
</cnsl-form-field>
|
||||
|
||||
<cnsl-form-field class="smtp-form-field" label="User" required="true">
|
||||
|
||||
+6
-5
@@ -59,7 +59,7 @@ export class NotificationSettingsComponent implements OnInit {
|
||||
senderAddress: [{ disabled: true, value: '' }, [Validators.required]],
|
||||
senderName: [{ disabled: true, value: '' }, [Validators.required]],
|
||||
tls: [{ disabled: true, value: true }, [Validators.required]],
|
||||
host: [{ disabled: true, value: '' }, [Validators.required]],
|
||||
hostAndPort: [{ disabled: true, value: '' }, [Validators.required]],
|
||||
user: [{ disabled: true, value: '' }, [Validators.required]],
|
||||
});
|
||||
}
|
||||
@@ -85,6 +85,7 @@ export class NotificationSettingsComponent implements OnInit {
|
||||
if (smtpConfig.smtpConfig) {
|
||||
this.hasSMTPConfig = true;
|
||||
this.form.patchValue(smtpConfig.smtpConfig);
|
||||
this.form.patchValue({ ['hostAndPort']: smtpConfig.smtpConfig.host });
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -139,7 +140,7 @@ export class NotificationSettingsComponent implements OnInit {
|
||||
private updateData(): Promise<UpdateSMTPConfigResponse.AsObject | AddSMTPConfigResponse> {
|
||||
if (this.hasSMTPConfig) {
|
||||
const req = new UpdateSMTPConfigRequest();
|
||||
req.setHost(this.host?.value ?? '');
|
||||
req.setHost(this.hostAndPort?.value ?? '');
|
||||
req.setSenderAddress(this.senderAddress?.value ?? '');
|
||||
req.setSenderName(this.senderName?.value ?? '');
|
||||
req.setTls(this.tls?.value ?? false);
|
||||
@@ -148,7 +149,7 @@ export class NotificationSettingsComponent implements OnInit {
|
||||
return this.service.updateSMTPConfig(req);
|
||||
} else {
|
||||
const req = new AddSMTPConfigRequest();
|
||||
req.setHost(this.host?.value ?? '');
|
||||
req.setHost(this.hostAndPort?.value ?? '');
|
||||
req.setSenderAddress(this.senderAddress?.value ?? '');
|
||||
req.setSenderName(this.senderName?.value ?? '');
|
||||
req.setTls(this.tls?.value ?? false);
|
||||
@@ -305,7 +306,7 @@ export class NotificationSettingsComponent implements OnInit {
|
||||
return this.form.get('user');
|
||||
}
|
||||
|
||||
public get host(): AbstractControl | null {
|
||||
return this.form.get('host');
|
||||
public get hostAndPort(): AbstractControl | null {
|
||||
return this.form.get('hostAndPort');
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<div mat-dialog-content>
|
||||
<cnsl-form-field class="formfield">
|
||||
<cnsl-label>{{ data.i18nLabel | translate }}</cnsl-label>
|
||||
<input cnslInput [(ngModel)]="password" />
|
||||
<input cnslInput [(ngModel)]="password" type="password" autocomplete="new-password" />
|
||||
</cnsl-form-field>
|
||||
</div>
|
||||
<div mat-dialog-actions class="action">
|
||||
|
||||
Reference in New Issue
Block a user