From d9b743d3b08b8031f3499fccc8a83289959c4603 Mon Sep 17 00:00:00 2001 From: hughhhh Date: Fri, 25 Jun 2021 08:22:52 -0700 Subject: [PATCH] fix password error filter --- superset-frontend/src/views/CRUD/hooks.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/views/CRUD/hooks.ts b/superset-frontend/src/views/CRUD/hooks.ts index 0d216ed3df061..194b60928d6d7 100644 --- a/superset-frontend/src/views/CRUD/hooks.ts +++ b/superset-frontend/src/views/CRUD/hooks.ts @@ -656,11 +656,13 @@ export function useDatabaseValidation() { if (typeof e.json === 'function') { e.json().then(({ errors = [] }: JsonObject) => { const parsedErrors = errors - .filter( - (error: { error_type: string }) => - error.error_type !== - 'CONNECTION_MISSING_PARAMETERS_ERROR' || onCreate, - ) + .filter((error: { error_type: string }) => { + const skipValidationError = ![ + 'CONNECTION_MISSING_PARAMETERS_ERROR', + 'CONNECTION_ACCESS_DENIED_ERROR', + ].includes(error.error_type); + return skipValidationError || onCreate; + }) .reduce( ( obj: {},