feat: add certificate validation

This commit is contained in:
Shivam Mishra
2025-09-02 16:52:16 +05:30
parent 4b12f13926
commit 1030bf69e1
4 changed files with 31 additions and 3 deletions
@@ -113,7 +113,16 @@ const saveSamlSettings = async settings => {
useAlert(t('SECURITY_SETTINGS.SAML.API.DISABLED'));
}
} catch (error) {
useAlert(t('SECURITY_SETTINGS.SAML.API.ERROR'));
// Handle backend validation errors
if (error.response?.data?.errors) {
const errorMessages = error.response.data.errors;
const firstError = Array.isArray(errorMessages)
? errorMessages[0]
: errorMessages;
useAlert(firstError);
} else {
useAlert(t('SECURITY_SETTINGS.SAML.API.ERROR'));
}
throw error;
} finally {
isSubmitting.value = false;