Search code examples
angularjshello.js

hello.js login() error: 'Popup was blocked' fires upon showing user the login popup


Here's my app code, within an angular controller:

hello.init({
    google: GOOGLE_CLIENT_ID
}, { redirect_uri: '/home/redirect' });

hello('google').login().then(function(){
    alert('You are signed in');
}, function(e){
    alert('Signin error: ' + e.error.message);
});

When the controller loads, the user sees the signin prompt, and then can login successfully. But underneath the covers, my controller thinks the login failed (see screenshot). This is running in Internet Explorer 11, in an ASP.NET 4 web app.screenshot of login prompt & error breakpoint launched simultaneously


Solution

  • Answered my own question after some more digging. My redirect.html didn't have the hello.js script rendered in the DOM.