Skip to content

Commit fac154d

Browse files
author
Fabrizio Mirabito
authored
Merge pull request #228 from arduino/fmirabito/update_auth_ep
Change authentication endpoint
2 parents 44c9543 + cb84905 commit fac154d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arduino-iot-js",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"license": "GPLv3",
55
"description": "JS module providing Arduino Create IoT Cloud Connection",
66
"main": "lib/index.js",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const subscribedTopics = {};
5454
const propertyCallback = {};
5555
const arduinoCloudPort = 8443;
5656
const arduinoCloudHost = 'wss.iot.arduino.cc';
57-
const arduinoAuthURL = 'https://auth.arduino.cc';
57+
const arduinoAuthURL = 'https://api2.arduino.cc';
5858

5959
const getUserId = (apiUrl, token) => fetch(apiUrl, {
6060
method: 'get',
@@ -102,7 +102,7 @@ const connect = options => new Promise((resolve, reject) => {
102102
return reject(new Error('no apiUrl parameter is provided'));
103103
}
104104

105-
return getUserId(`${opts.apiUrl}/v1/users/byID/me`, options.token).then((res) => {
105+
return getUserId(`${opts.apiUrl}/users/v1/users/byID/me`, options.token).then((res) => {
106106
const clientID = `${res.id}:${new Date().getTime()}`;
107107
const client = new Paho.Client(opts.host, opts.port, clientID);
108108
client.topics = {};

0 commit comments

Comments
 (0)