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

How to handle "Uncaught Error: The user chose to ignore the dialog box"? #39

Closed antifun closed 7 years ago

antifun commented 7 years ago

Is there a way to catch or handle this error (thrown if the user clicks "Ignore" when prompted to open a new window for oauth)?

I've got a .catch in place which is reached if the user closes the opened dialog prematurely, but there doesn't seem to be any higher level with which to wrap the call to authenticate.

authenticator
    .authenticate(`${subdomain}.${domain}`, force)
    .then(function(token) {
      console.log("got token", token)
      return token
    })
    .catch(function(err) {
      console.log("error authenticating (user closed dialog)", err)
    })
WrathOfZombies commented 7 years ago

@IanVS Could you attach some screenshots/gif of the same. Given that the helpers works differently in different platforms, I'd need some visual cues to see how we can best help.

IanVS commented 7 years ago

Sure, I posted some over in https://github.com/OfficeDev/office-js-helpers/issues/40#issuecomment-323911412. But I didn't open this particular issue. Maybe you meant to ask @antifun?

antifun commented 7 years ago

Yes, I think (at least the way I have it configured in the manifest) that this only happens in the web app.

WrathOfZombies commented 7 years ago

Closing this as a dupe. The referenced issue will track this.