ti2-ventrata 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -239,24 +239,19 @@ class Plugin {
|
|
|
239
239
|
token: {
|
|
240
240
|
apiKey,
|
|
241
241
|
endpoint,
|
|
242
|
-
octoEnv,
|
|
243
|
-
acceptLanguage,
|
|
244
242
|
},
|
|
245
243
|
}) {
|
|
246
|
-
const url = `${endpoint || this.endpoint}/
|
|
244
|
+
const url = `${endpoint || this.endpoint}/whoami?token=${apiKey}`;
|
|
247
245
|
const headers = getHeaders({
|
|
248
246
|
apiKey,
|
|
249
|
-
endpoint,
|
|
250
|
-
octoEnv,
|
|
251
|
-
acceptLanguage,
|
|
252
247
|
});
|
|
253
248
|
try {
|
|
254
|
-
const
|
|
249
|
+
const connectionId = R.path(['data', 'connection', 'id'], await axios({
|
|
255
250
|
method: 'get',
|
|
256
251
|
url,
|
|
257
252
|
headers,
|
|
258
253
|
}));
|
|
259
|
-
return
|
|
254
|
+
return /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/.test(connectionId);
|
|
260
255
|
} catch (err) {
|
|
261
256
|
return false;
|
|
262
257
|
}
|