TLS Options Set Up
This commit is contained in:
1 parent
01ed3d8aaa
commit
7e1a7066fc
3 files changed
+18
-3
No files matched your search
@@ -56,17 +56,21 @@ const Settings = () => {
|
||||
|
||||
// Handlers
|
||||
const handleChange = async (e) => {
|
||||
const { name, value } = e.target;
|
||||
const { name, value, checked } = e.target;
|
||||
|
||||
// Special case for showURL until handled properly in the backend
|
||||
if (name === "showURL") {
|
||||
dispatch(setShowURL(value));
|
||||
return;
|
||||
}
|
||||
let newValue;
|
||||
if (name === "systemEmailIgnoreTLS" || name === "systemEmailRequireTLS" || name === "systemEmailRejectUnauthorized") {
|
||||
newValue = checked;
|
||||
}
|
||||
// Build next state early
|
||||
const newSettingsData = {
|
||||
...settingsData,
|
||||
settings: { ...settingsData.settings, [name]: value },
|
||||
settings: { ...settingsData.settings, [name]: newValue ?? value },
|
||||
};
|
||||
|
||||
// Validate
|
||||
|
||||
@@ -294,6 +294,10 @@ const settingsValidation = joi.object({
|
||||
systemEmailPassword: joi.string().allow(""),
|
||||
systemEmailUser: joi.string().allow(""),
|
||||
systemEmailConnectionHost: joi.string().allow(""),
|
||||
systemEmailTLSServername: joi.string().allow(""),
|
||||
systemEmailIgnoreTLS: joi.boolean().optional(),
|
||||
systemEmailRequireTLS: joi.boolean().optional(),
|
||||
systemEmailRejectUnauthorized: joi.boolean().optional(),
|
||||
});
|
||||
|
||||
const dayjsValidator = (value, helpers) => {
|
||||
|
||||
Reference in new issue
Block a user