Meteor loginWIthGoogle problems
<p>I have a page with a condition using a reactive variable that is initially false, but when you login, using facebook or google it changes to true, and the content of the page changes. </p>

<p>When i login using facebook everything goes well but when i login using google, the variable "isAuthenticated" doesn't changes to true, but if i navigate to another page, it appears as the user is logged in, so i thing what is happening is that when i do if(Meteor.userId()) authentication with google is not done yet, so it skips this step and doesnt changes the value of the variable. How can i wait till the authentication is completed? If i click again in the login with google it then enters the condition, it only doesnt work when the user is initially not logged in.</p>

<p>This is my login with google method:</p>

<pre><code> 'click #google-login': function(event) { 
        event.preventDefault();
        Meteor.loginWithGoogle({}, function(err){
            if (err) {
                return swal({
                    title: "Google Login Failed",
                    timer: 1700,
                    showConfirmButton: false,
                    type: "error"
                });                
                throw new Meteor.Error("Google login failed");
                Template.instance().authenticated.set(false);
            }
        });
            if(Meteor.userId()){
            //Enable idea submission
            Template.instance().authenticated.set(true);
            }
            //Update last login 
            Meteor.users.update( { _id: Meteor.userId() }, {$set: {"metadata.lastLoginAt": new Date()}});
    }
</code></pre>

<p>Any help would be appreciated!</p>