diff --git a/keep-ui/app/providers/provider-form.tsx b/keep-ui/app/providers/provider-form.tsx index 89516d493..555b3da80 100644 --- a/keep-ui/app/providers/provider-form.tsx +++ b/keep-ui/app/providers/provider-form.tsx @@ -482,7 +482,18 @@ const ProviderForm = ({ }) .catch((error) => { const updatedFormErrors = error.toString(); - setFormErrors(updatedFormErrors); + + if (updatedFormErrors.includes("SyntaxError")) { + setFormErrors( + "Bad response from API: Check the backend logs for more details" + ); + } else if (updatedFormErrors.includes("Failed to fetch")) { + setFormErrors( + "Failed to connect to API: Check your internet connection" + ); + } else { + setFormErrors(updatedFormErrors); + } onFormChange(formValues, updatedFormErrors); setIsLoading(false); onConnectChange(false, false); diff --git a/keep-ui/pages/api/auth/[...nextauth].ts b/keep-ui/pages/api/auth/[...nextauth].ts index 55b8395b5..a27de974b 100644 --- a/keep-ui/pages/api/auth/[...nextauth].ts +++ b/keep-ui/pages/api/auth/[...nextauth].ts @@ -343,7 +343,7 @@ const azureADAuthOptions = { authorization: { params: { scope: - "api://d6cc6406-9de5-4a9f-bcf1-79e35e14cd2f/default openid profile email", + "api://" + process.env.KEEP_AZUREAD_CLIENT_ID! + "/default openid profile email", }, }, checks: ["pkce"],