- handle form save for jwtTTL

- update validation for advanced settings page black list some unused fields which causing errors
This commit is contained in:
Shemy Gan committed 2024-10-24 11:31:10 -04:00
1 parent a4344b89a2
commit 57edff36c9
3 files changed
+50 -23

No files matched your search

+15 -3
View File
@@ -15,10 +15,22 @@ const hasValidationErrors = (form, validation, setErrors) => {
if (error) {
const newErrors = {};
error.details.forEach((err) => {
newErrors[err.path[0]] = err.message?? "Validation error";
if (
![
"clientHost",
"refreshTokenSecret",
"dbConnectionString",
"refreshTokenTTL",
"jwtTTL",
].includes(err.path[0])
) {
newErrors[err.path[0]] = err.message ?? "Validation error";
}
});
setErrors(newErrors);
return true;
if (Object.keys(newErrors).length > 0) {
setErrors(newErrors);
return true;
} else return false;
}
return false;
};