diff --git a/cmd/defaults.yaml b/cmd/defaults.yaml index 2ae739a54c..e171c6e611 100644 --- a/cmd/defaults.yaml +++ b/cmd/defaults.yaml @@ -361,7 +361,7 @@ DefaultInstance: DomainPolicy: UserLoginMustBeDomain: true ValidateOrgDomains: true - SMTPSenderAddressMatchesInstanceDomain: true + SMTPSenderAddressMatchesInstanceDomain: false LoginPolicy: AllowUsernamePassword: true AllowRegister: true diff --git a/console/src/app/modules/policies/notification-settings/notification-settings.component.ts b/console/src/app/modules/policies/notification-settings/notification-settings.component.ts index a4c48bd7b0..bfb0de9821 100644 --- a/console/src/app/modules/policies/notification-settings/notification-settings.component.ts +++ b/console/src/app/modules/policies/notification-settings/notification-settings.component.ts @@ -3,12 +3,14 @@ import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } fro import { MatDialog } from '@angular/material/dialog'; import { take } from 'rxjs'; import { - AddSMSProviderTwilioRequest, - AddSMTPConfigRequest, - UpdateSMSProviderTwilioRequest, - UpdateSMTPConfigPasswordRequest, - UpdateSMTPConfigPasswordResponse, - UpdateSMTPConfigRequest, + AddSMSProviderTwilioRequest, + AddSMTPConfigRequest, + AddSMTPConfigResponse, + UpdateSMSProviderTwilioRequest, + UpdateSMTPConfigPasswordRequest, + UpdateSMTPConfigPasswordResponse, + UpdateSMTPConfigRequest, + UpdateSMTPConfigResponse, } from 'src/app/proto/generated/zitadel/admin_pb'; import { DebugNotificationProvider, SMSProvider, SMSProviderConfigState } from 'src/app/proto/generated/zitadel/settings_pb'; import { AdminService } from 'src/app/services/admin.service'; @@ -134,7 +136,7 @@ export class NotificationSettingsComponent implements OnInit { }); } - private updateData(): Promise | any { + private updateData(): Promise { if (this.hasSMTPConfig) { const req = new UpdateSMTPConfigRequest(); req.setHost(this.host?.value ?? ''); @@ -143,9 +145,7 @@ export class NotificationSettingsComponent implements OnInit { req.setTls(this.tls?.value ?? false); req.setUser(this.user?.value ?? ''); - return this.service.updateSMTPConfig(req).catch((error) => { - this.toast.showError(error); - }); + return this.service.updateSMTPConfig(req); } else { const req = new AddSMTPConfigRequest(); req.setHost(this.host?.value ?? ''); @@ -154,26 +154,21 @@ export class NotificationSettingsComponent implements OnInit { req.setTls(this.tls?.value ?? false); req.setUser(this.user?.value ?? ''); - return this.service.addSMTPConfig(req).catch((error) => { - this.toast.showError(error); - }); + return this.service.addSMTPConfig(req); } } public savePolicy(): void { - const prom = this.updateData(); - if (prom) { - prom - .then(() => { - this.toast.showInfo('SETTING.SMTP.SAVED', true); - setTimeout(() => { - this.fetchData(); - }, 2000); - }) - .catch((error: unknown) => { - this.toast.showError(error); - }); - } + this.updateData() + .then(() => { + this.toast.showInfo('SETTING.SMTP.SAVED', true); + setTimeout(() => { + this.fetchData(); + }, 2000); + }) + .catch((error: unknown) => { + this.toast.showError(error); + }); } public editSMSProvider(): void {