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

Fixes issue 102 #106

Open sremiger1 opened 6 years ago

sremiger1 commented 6 years ago

In IE or the outlook desktop the token can be deleted if the token is expired. The get method to get the token actual token without the expire check is over written, therefore the calls to the get method that checks to the token to be expired is being called in the delete method and the infinite loop is created.

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

sremiger1 commented 6 years ago

The old get within the token manager is being called and only returns a token if it is valid. If the token is expired this method attempts to delete that same token, by calling the delete method. The delete method in-turn called the old get method. So the code ends up going out of stack. By renaming this method to getValidToken, this method will return a valid token only. Using the same code now, when the token is expired and the delete is called the delete will call the super get that does not validate the token, it just returns a token if found.