2

I'm bumping into a weird problem in Google Apps Script, working on a Slides add-on.

When I run the add-on in an incognito window with just one user logged in (call it User B), everything works fine.

When I run the add-on with multiple users logged in (call it Users A and B in the same Chrome tab), it seems like Apps Script gets confused around the authorization. When I try to use the add-on as User B (as evidenced by the profile showing up in the upper right corner), all functionality of the add-on fails, I'm guessing because it lacks authorization. Note that the add-on has remain installed on User B's account this whole time, and it still works in the incognito window with just User B logged in.

Any tips on this? Is there a way to "force" the add-on to use the authorization of User B in the multi-logged-in case?

Rubén
  • 34,714
  • 9
  • 70
  • 166
ajyang818
  • 495
  • 1
  • 5
  • 16

3 Answers3

6

Having multiple log-ins active in the same browser is known to cause issues with Google Authorization.

The default account (typically the account that was first logged into) takes precedence over any other accounts. Google has yet to fully resolve this. Current work-around is to recommend to your users to log out of all other accounts.

TheAddonDepot
  • 8,408
  • 2
  • 20
  • 30
  • Thanks for linking that! Wow, that's really unfortunate. I ended up implementing a workaround where I created a new menu item that goes directly to the new modal I wanted to pop up. Then in the original place where I tried to invoke that modal, I added a try/catch where, if there's an error, a new message shows up in the sidebar asking the user to try the new menu option. Not a great experience, but at least it's somewhat of an escape hatch... – ajyang818 Feb 18 '19 at 18:56
  • How do I determine if the user has logged in from multiple accounts? – Amit Singh Nov 30 '22 at 18:53
1

I had the same problem and got it solved by changing the link as follows:

https://script.google.com/a/{any_character}/macros/s/{deployment_id}/exec

Note that my app was set public so anyone can access it.

0

Use this url to test instead:

https://script.google.com/a/{domain name}/macros/s/{token}/exec
lastlink
  • 1,505
  • 2
  • 19
  • 29