OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 56 forks source link

container params colliding for endpoints and token storage #65

Closed ayushsood closed 6 years ago

ayushsood commented 6 years ago

See:

If you set up an OAuth endpoint via:

const authenticator = new Authenticator();
authenticator.endpoints.add(OAUTH_CLIENT.clientName, {
  clientId: OAUTH_CLIENT.clientId,
  baseUrl: OAUTH_CLIENT.baseUrl,
  authorizeUrl: OAUTH_CLIENT.authorizeUrl,
  responseType: 'token'
});

And try to print out a token (should be null), via:

console.log(authenticator.tokens.get(OAUTH_CLIENT.clientName));

You get the endpoint configuration back.

Suggested fix: Change line 36 in token.manager.ts to super('OAuth2Tokens', storageType);

WrathOfZombies commented 6 years ago

There was a bug in the container name. This has been addressed recently. I'll push a new update to the library.

Thanks

WrathOfZombies commented 6 years ago

Fixed in https://unpkg.com/@microsoft/office-js-helpers@1.0.1/dist/office.helpers.js