diff --git a/package-lock.json b/package-lock.json index b92f1eb..b967de8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "arduino-iot-js", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f641cd0..52b04a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arduino-iot-js", - "version": "0.5.0", + "version": "0.5.1", "license": "GPLv3", "description": "JS module providing Arduino Create IoT Cloud Connection", "main": "lib/index.js", diff --git a/src/index.js b/src/index.js index 239ee39..961f37a 100644 --- a/src/index.js +++ b/src/index.js @@ -54,7 +54,7 @@ const subscribedTopics = {}; const propertyCallback = {}; const arduinoCloudPort = 8443; const arduinoCloudHost = 'wss.iot.arduino.cc'; -const arduinoAuthURL = 'https://auth.arduino.cc'; +const arduinoAuthURL = 'https://api2.arduino.cc'; const getUserId = (apiUrl, token) => fetch(apiUrl, { method: 'get', @@ -102,7 +102,7 @@ const connect = options => new Promise((resolve, reject) => { return reject(new Error('no apiUrl parameter is provided')); } - return getUserId(`${opts.apiUrl}/v1/users/byID/me`, options.token).then((res) => { + return getUserId(`${opts.apiUrl}/users/v1/users/byID/me`, options.token).then((res) => { const clientID = `${res.id}:${new Date().getTime()}`; const client = new Paho.Client(opts.host, opts.port, clientID); client.topics = {};