news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

Authorization issues / multiple Google accounts problems with sidebar #393

Open jacqui opened 2 years ago

jacqui commented 2 years ago

Some of the cohort are experiencing annoying problems with authorization in the sidebar that stem from being logged in with a different Google account than the one authorized for the sidebar.

From Tyler:

I was reading more yesterday about the multiple Google accounts issue, and someone claims to have solved it https://apps.myrout.es/msii

My understanding is that it works by calling the Google Apps Script API with an OAuth token from the signed in user, instead of using google.script.run , which looks at the default account. The problem is you can’t use getActiveDocument, but if you can pass the doc URL/ID you can get the same data by using that information instead.

chelsea-tnc commented 2 years ago

Hi @pdeharo333 , do you know if anyone is still running into this issue? Looks like this bug was from January.

TylerFisher commented 2 years ago

This is a known issue with how Google Apps Script works. If you're signed into multiple accounts in your Google login chain, the apps script will look at your default account no matter which account you are technically logged into at the moment. There is a very long issue here in Google's official bug tracker.

Our member docs go over how to work around this for now. It's an annoying issue, but not one we can do a ton about on our own.

chelsea-tnc commented 2 years ago

Deferring this until Google has implemented a workaround. See the issue Tyler mentioned above.