Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gapi.auth2.getAuthInstance().isSignedIn.get() is always false when Chrome Browser has multiple accounts

I copied the example given in Google Calendar API Quickstart and replaced it with the appropriate info. Every time I refresh the page, I'm asked to authorize before api data is fetched.

I'm using Chrome and I currently have multiple accounts / users. I noticed if I open an Incognito Window and sign in with one set of credentials then when I refresh the page I'm not asked to authorize.

Note, once I authenticate I receive calendar information so I don't believe it's an issue with client_id, api_key, scope, etc.

Looking at the example code, I'm guessing the getAuthInstance() is getting confused because of multiple accounts / users. Does anyone have any idea? Thanks!

like image 550
blinkmacalahan Avatar asked Nov 07 '22 08:11

blinkmacalahan


1 Answers

This was happening when running on localhost. This issue stopped happening after deploying the webpage to a hosted server.

like image 106
blinkmacalahan Avatar answered Nov 30 '22 20:11

blinkmacalahan