auth.signIn() promise resolving immediately AND opening login window

21 views
Skip to first unread message

Ariel Jakobovits

unread,
Nov 13, 2015, 8:46:46 AM11/13/15
to Google API JavaScript Client

I have this code:

return auth.signIn().then(function() {
    return handleConnect(auth.currentUser.get());
});

I am seeing the handleConnect function called twice, once immediately and a second time after I login to Google using the popup window.

I added this code:

if (auth.isSignedIn.get() === true) {
    return handleConnect(auth.currentUser.get());
} 
else {
    return auth.signIn().then(function() {
        return handleConnect(auth.currentUser.get());
    });
}

But auth.isSignedIn.get() equals false and the auth.signIn() is still happening.

Any idea why?

Reply all
Reply to author
Forward
0 new messages