diff --git a/index.js b/index.js index f8e8beca3d649a68ff43c70e0c00f931f71bc28a..6e1a8823fdacf56f2f31b1f4ed4b5157c1765920 100644 --- a/index.js +++ b/index.js @@ -214,9 +214,10 @@ async function start(fields, cozyParameters) { contractId, pointId, boBaseUrl, - boToken + boToken, + consentEndDate < today ) - throw errors.USER_ACTION_NEEDED_OAUTH_OUTDATED + // throw errors.USER_ACTION_NEEDED_OAUTH_OUTDATED } } log('info', 'Successfully logged in') @@ -234,6 +235,7 @@ async function start(fields, cozyParameters) { * @param {number} pointId * @param {string} boBaseUrl * @param {string} boToken + * @param {boolean} isConsentExpiration */ async function deleteConsent( userConsent, @@ -243,7 +245,8 @@ async function deleteConsent( contractId, pointId, boBaseUrl, - boToken + boToken, + isConsentExpiration ) { log('error', `Invalid or not found consent for user`) if (userConsent.serviceID) { @@ -260,6 +263,9 @@ async function deleteConsent( log('error', `No service id retrieved from BO`) throw errors.VENDOR_DOWN } + if (isConsentExpiration) { + throw errors.USER_ACTION_NEEDED_OAUTH_OUTDATED + } throw errors.TERMS_VERSION_MISMATCH } @@ -228389,6 +228395,7 @@ async function findUserPdl( return parseUserPdl(parsedReply) } catch (error) { log('error', 'Error while parsing user PDL: ' + error) + if (parsedReply.Envelope.Body.Fault) { log( 'error',