{"action":"created","issue":{"url":"https://api.github.com/repos/google/google-api-javascript-client/issues/405","repository_url":"https://api.github.com/repos/google/google-api-javascript-client","labels_url":"https://api.github.com/repos/google/google-api-javascript-client/issues/405/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-javascript-client/issues/405/comments","events_url":"https://api.github.com/repos/google/google-api-javascript-client/issues/405/events","html_url":"https://github.com/google/google-api-javascript-client/issues/405","id":302187358,"number":405,"title":"`popup_closed_by_user` thrown when calling `signIn` in Chrome","user":{"login":"sugarmanz","id":9255651,"avatar_url":"https://avatars1.githubusercontent.com/u/9255651?v=4","gravatar_id":"","url":"https://api.github.com/users/sugarmanz","html_url":"https://github.com/sugarmanz","followers_url":"https://api.github.com/users/sugarmanz/followers","following_url":"https://api.github.com/users/sugarmanz/following{/other_user}","gists_url":"https://api.github.com/users/sugarmanz/gists{/gist_id}","starred_url":"https://api.github.com/users/sugarmanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sugarmanz/subscriptions","organizations_url":"https://api.github.com/users/sugarmanz/orgs","repos_url":"https://api.github.com/users/sugarmanz/repos","events_url":"https://api.github.com/users/sugarmanz/events{/privacy}","received_events_url":"https://api.github.com/users/sugarmanz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-05T06:38:52Z","updated_at":"2018-03-21T04:10:50Z","closed_at":null,"author_association":"NONE","body":"From all of the browsers I've tested, this only seems to occur on Chrome, both incognito and in an authenticated browser. First, I check if the `gapi` object is properly authenticated. If not, I call the `signIn` method to authenticate. If the browser is not authenticated, the popup works as intended and I am able to sign in and then the `signIn` promise resolves. However, if the browser is already linked to a Google account, the popup opens and immediately closes (I assume this is because it is trying to use the authenticated account). This causes the `popup_closed_by_user` exception to be thrown and the `gapi` object is never authenticated. Below is the code.\r\n```\r\nconst auth = gapi.auth2.getAuthInstance();\r\nif (!auth.isSignedIn.get()) {\r\n   auth.signIn().then(() => // Do the thing);\r\n} else {\r\n   // Do the thing\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/google/google-api-javascript-client/issues/comments/374829724","html_url":"https://github.com/google/google-api-javascript-client/issues/405#issuecomment-374829724","issue_url":"https://api.github.com/repos/google/google-api-javascript-client/issues/405","id":374829724,"user":{"login":"wjf444128852","id":16033932,"avatar_url":"https://avatars3.githubusercontent.com/u/16033932?v=4","gravatar_id":"","url":"https://api.github.com/users/wjf444128852","html_url":"https://github.com/wjf444128852","followers_url":"https://api.github.com/users/wjf444128852/followers","following_url":"https://api.github.com/users/wjf444128852/following{/other_user}","gists_url":"https://api.github.com/users/wjf444128852/gists{/gist_id}","starred_url":"https://api.github.com/users/wjf444128852/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjf444128852/subscriptions","organizations_url":"https://api.github.com/users/wjf444128852/orgs","repos_url":"https://api.github.com/users/wjf444128852/repos","events_url":"https://api.github.com/users/wjf444128852/events{/privacy}","received_events_url":"https://api.github.com/users/wjf444128852/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T04:10:50Z","updated_at":"2018-03-21T04:10:50Z","author_association":"NONE","body":"I got the same problem ,this example online.\r\nClicking Google sign in and Google sign out will works on any browser.\r\n[https://wjf444128852.github.io/demo01/login/](https://wjf444128852.github.io/demo01/login/)"}}
{"actor":{"display_login":"wjf444128852"}}