Refresh always redirects to a specific page

Problem:
I am using Meteor.loginWithFacebook with a redirect login instead of a pop-up. In order to ensure a user has logged in I have written the following code.

Accounts.onLogin(function() {
    Router.go('/create')
});

Accounts.onLoginFailure(function(){
    console.log('Failed');
});

I have also tried the following code.

Tracker.autorun(function(){
    if(Meteor.userId()){
       Router.go('/create')
    } else if (!Meteor.userId()){
       Router.go('/')
    }
});

The redirects after login are successful. The problem arises when a page refreshes. I am constantly being redirected to the ‘/create’ page.

Thoughts:
I believe that Meteor checks if a user is logged in every time a page is opened or refreshed. This functionality forces my login check code to run. Thus, I am always being redirected to the ‘/create’ page.

I was wondering if someone knew of an elegant solution to prevent this redirect from happening.

you can use to approaches to the problem.

  1. you can check for user loggin in when page refreshes

    Tracker.autorun(function(){
    if(!Meteor.loggingIn() && Meteor.userId()){
    Router.go(’/create’)
    } else if (!Meteor.userId()){
    Router.go(’/’)
    }
    });

  2. using fastrender instant login feature