Realm email doesn't default to port 25 (#3129)

This commit is contained in:
Stan Silvert 2022-08-17 12:59:34 -04:00 committed by GitHub
parent f76259088e
commit ed139b62cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,6 +69,10 @@ export const RealmSettingsEmailTab = ({
}
const savedRealm = { ...realm, ...form };
// For default value, back end is expecting null instead of empty string
if (savedRealm.smtpServer?.port === "") savedRealm.smtpServer.port = null;
await adminClient.realms.update({ realm: realmName }, savedRealm);
setRealm(savedRealm);
addAlert(t("saveSuccess"), AlertVariant.success);
@ -93,6 +97,9 @@ export const RealmSettingsEmailTab = ({
serverSettings[key] = mapperFn(serverSettings[key]);
}
// For default value, back end is expecting null instead of 0
if (serverSettings.port === 0) serverSettings.port = null;
try {
const registered = await registerEmailIfNeeded();