attlaz-client 1.13.13 → 1.13.14

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.
@@ -177,7 +177,14 @@ export class OAuthClient {
177
177
  return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
178
178
  }
179
179
  tokenToOauthClientToken(oauthToken) {
180
- const token = new OAuthClientToken(oauthToken.accessToken, oauthToken.tokenType, oauthToken.refreshToken, oauthToken.data.scopes);
180
+ let scopes = '';
181
+ if (Object.prototype.hasOwnProperty.call(oauthToken.data, 'scopes')) {
182
+ scopes = oauthToken.data.scopes;
183
+ }
184
+ else if (Object.prototype.hasOwnProperty.call(oauthToken.data, 'scope')) {
185
+ scopes = oauthToken.data.scope;
186
+ }
187
+ const token = new OAuthClientToken(oauthToken.accessToken, oauthToken.tokenType, oauthToken.refreshToken, scopes);
181
188
  const rawTokenExpires = oauthToken.expires;
182
189
  if (rawTokenExpires !== null && rawTokenExpires !== undefined) {
183
190
  token.expires = rawTokenExpires;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.13.13",
3
+ "version": "1.13.14",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",