diff --git a/index.js b/index.js index ee09d2ed46a4b6c71e8c627ba92533b6758c4dc4..eda678400bd446f86ea107dd28c49b55c1228163 100644 --- a/index.js +++ b/index.js @@ -76,7 +76,7 @@ Sentry.init({ // The start function is run by the BaseKonnector instance only when it got all the account // information (fields). When you run this connector yourself in 'standalone' mode or 'dev' mode, // the account information come from ./konnector-dev-config.json file -async function start(fields, cozyParameters) { +async function start(fields, cozyParameters, cozyUrl) { const transaction = Sentry.startTransaction({ op: 'konnector', name: 'EGL Konnector', @@ -94,7 +94,8 @@ async function start(fields, cozyParameters) { fields.login, fields.password, baseUrl, - apiAuthKey + apiAuthKey, + cozyUrl ) log('info', 'Successfully logged in') @@ -206,7 +207,7 @@ async function buildAggregatedData(data, doctype) { return aggregatedData } -async function authenticate(login, password, baseUrl, apiAuthKey) { +async function authenticate(login, password, baseUrl, apiAuthKey, cozyUrl) { const authRequest = { method: 'post', url: baseUrl + '/connect.aspx', @@ -236,8 +237,8 @@ async function authenticate(login, password, baseUrl, apiAuthKey) { section: 'authenticate', }, extra: { - test: 'test', - who: login, + compte: login, + url: cozyUrl, }, }) throw new Error(errors.LOGIN_FAILED)