diff --git a/client/src/components/InputsModal/InputsModal.tsx b/client/src/components/InputsModal/InputsModal.tsx index d78cf5be0..48f7186ed 100644 --- a/client/src/components/InputsModal/InputsModal.tsx +++ b/client/src/components/InputsModal/InputsModal.tsx @@ -96,10 +96,10 @@ const InputsModal: FC = ({ const oAuthJSON = JSON.parse( (inputsMap.get(input.name) as string) || '{ "access_token": null }' ) as OAuthCredentials; - const accessTokenIsEmpty = oAuthJSON.access_token === ''; - const refreshIsEmpty = - oAuthJSON.refresh_token !== '' && (!oAuthJSON.token_url || !oAuthJSON.client_id); - oAuthMissingRequiredInput = (accessTokenIsEmpty && !input.optional) || refreshIsEmpty; + const accessTokenIsEmpty = !oAuthJSON.access_token; + const refreshTokenIsEmpty = + !!oAuthJSON.refresh_token && (!oAuthJSON.token_url || !oAuthJSON.client_id); + oAuthMissingRequiredInput = (!input.optional && accessTokenIsEmpty) || refreshTokenIsEmpty; } catch (e: unknown) { const errorMessage = e instanceof Error ? e.message : String(e); enqueueSnackbar(`OAuth credentials incorrectly formatted: ${errorMessage}`, {