fix(api): throw errors for all non-ok responses (#8880)

This commit is contained in:
Alan Buscaglia
2025-10-10 10:47:04 +02:00
committed by GitHub
parent 1483efa18e
commit ef60ea99c3
3 changed files with 17 additions and 5 deletions

View File

@@ -7,8 +7,8 @@ All notable changes to the **Prowler UI** are documented in this file.
### 🚀 Added
- Support for Markdown and AdditionalURLs in findings detail page [(#8704)](https://github.com/prowler-cloud/prowler/pull/8704)
- `Prowler Hub` menu item with tooltip [(#8692)] (https://github.com/prowler-cloud/prowler/pull/8692)
- Copy link button to finding detail page [(#8685)] (https://github.com/prowler-cloud/prowler/pull/8685)
- `Prowler Hub` menu item with tooltip [(#8692)](https://github.com/prowler-cloud/prowler/pull/8692)
- Copy link button to finding detail page [(#8685)](https://github.com/prowler-cloud/prowler/pull/8685)
- React Compiler support for automatic optimization [(#8748)](https://github.com/prowler-cloud/prowler/pull/8748)
- Turbopack support for faster development builds [(#8748)](https://github.com/prowler-cloud/prowler/pull/8748)
- Add compliance name in compliance detail view [(#8775)](https://github.com/prowler-cloud/prowler/pull/8775)
@@ -28,6 +28,7 @@ All notable changes to the **Prowler UI** are documented in this file.
### 🐞 Fixed
- SAML configuration errors are now properly caught and displayed [(#8880)](https://github.com/prowler-cloud/prowler/pull/8880)
- ThreatScore for each pillar in Prowler ThreatScore specific view [(#8582)](https://github.com/prowler-cloud/prowler/pull/8582)
---
@@ -96,7 +97,7 @@ All notable changes to the **Prowler UI** are documented in this file.
- Disable `See Compliance` button until scan completes [(#8487)](https://github.com/prowler-cloud/prowler/pull/8487)
- Provider connection filter now shows "Connected/Disconnected" instead of "true/false" for better UX [(#8520)](https://github.com/prowler-cloud/prowler/pull/8520)
- Provider Uid filter on scan page to list all UIDs regardless of connection status [(#8375)] (https://github.com/prowler-cloud/prowler/pull/8375)
- Provider Uid filter on scan page to list all UIDs regardless of connection status [(#8375)](https://github.com/prowler-cloud/prowler/pull/8375)
### 🐞 Fixed

View File

@@ -40,7 +40,18 @@ export const createSamlConfig = async (_prevState: any, formData: FormData) => {
}),
});
await handleApiResponse(response, "/integrations", false);
const result = await handleApiResponse(response, "/integrations", false);
if (result.error) {
return {
errors: {
general:
result.error instanceof Error
? result.error.message
: "Error creating SAML configuration. Please try again.",
},
};
}
return { success: "SAML configuration created successfully!" };
} catch (error) {
console.error("Error creating SAML config:", error);

View File

@@ -75,7 +75,7 @@ const baseAuthSchema = z.object({
export const signInSchema = baseAuthSchema
.extend({
password: z.string().min(1, { message: "Password is required." }),
password: z.string(),
})
.refine(
(data) => {