Delay of updating with if statements

Hello to everyone,
I created a mini application with custom login always in the same page, to explain better I have a main page with the login and registration and when I do the login/registration I remain on the same page and where was the login form appear a “Welcome Back” panel.
The problem is that when I try to reload the page with F5 I get for like 2 seconds the old login form and then appear the “Welcome Back” panel. I’ve used the If statements of Blaze to manage the check of the current user logged in as we can see:

<template name="login">
    {{#if currentUser}}
    <div class=" card mb-4 shadow-sm">
        <div class="card-header">
          <h4 class="my-0 font-weight-normal">Welcome Back</h4>
        </div>
        <div class="card-body">
            TEST
        </div>
      </div>
      {{else}}
        <div id="panel-login" class=" card mb-4 shadow-sm">
                <div class="card-header">
                  <h4 class="my-0 font-weight-normal">Login Form</h4>
                </div>
                <div class="card-body">
                    <form class="login-form">
                        <div class="form-group">
                            <label for="InputEmail">Email address</label>
                            <input type="email" class="form-control" name="email" id="InputEmailLogin" aria-describedby="emailHelp" placeholder="Enter email">
                            <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
                        </div>
                        <div class="form-group">
                            <label for="InputPassword">Password</label>
                            <input type="password" name="password" class="form-control" id="InputPasswordLogin" placeholder="Password">
                        </div>
                        <button type="submit" class="btn btn-primary">Login</button>
                        <span>or <a href="#" class="register-link">Create an account</a></span>
                    </form>
                </div>
              </div>

              <div id="panel-register" class=" card mb-4 shadow-sm">
                    <div class="card-header">
                      <h4 class="my-0 font-weight-normal">Register Form</h4>
                    </div>
                    <div class="card-body">
                        <form class="register-form">
                            <div class="form-group">
                                <label for="InputEmail">Email address</label>
                                <input type="email" class="form-control" name="email" id="InputEmail" aria-describedby="emailHelp" placeholder="Enter email">
                                <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
                            </div>
                            <div class="form-group">
                                <label for="InputPassword">Password</label>
                                <input type="password" name="password" class="form-control" id="InputPassword" placeholder="Password">
                            </div>
                            <div class="form-group">
                                <label for="InputPassword">Repeat Password</label>
                                <input type="password" name="password2" class="form-control" id="InputPasswordConfirm" placeholder="Repeat Password">
                            </div>
                            <button type="submit" class="btn btn-primary">Register</button>
                            <span>or <a href="#" class="login-link">Login</a></span>
                        </form>
                    </div>
                  </div>
        {{/if}}
</template>

That’s my JS file where I manage the entire events of login/registration system:

Template.login.events({
    'click .register-link': function() {
        $('#panel-login').hide();
        $('#panel-register').show().addClass("animated fadeIn");
    },
    'click .login-link': function() {
        $('#panel-register').hide();
        $('#panel-login').show().addClass("animated fadeIn");
    },
    // Registration
    'submit .register-form': function(event) {
        var email = trimInput(event.target.email.value);
        var password = trimInput(event.target.password.value);
        var password2 = trimInput(event.target.password2.value);

        if(isNotEmpty(email) && isNotEmpty(password) && isNotEmpty(password2)
            && isEmail(email) && areValidPasswords(password,password2)) {

            Accounts.createUser({
                email: email,
                password: password,
                profile: {
                    userType: 'Normal'
                }
            }, function(err) {
                if(err) {
                    sAlert.error("There was an error with the registration, try again!");
                } else {
                    sAlert.success("Account Created! You are now logged in");
                }
            });
        }

        // Prevent Submit
        return false;

    },
    // Login
    'submit .login-form': function(event) {
        var email = event.target.email.value;
        var password = event.target.password.value;

        Meteor.loginWithPassword(email, password, function(err) {
            if(err) {
                event.target.email.value = email;
                event.target.password.value = password;
                sAlert.error("There is an error with your login, try again!");
            } else {
                sAlert.success("You are now logged in!");
                
            }
        })

        // Prevent Submit
        return false;
    }

});

Template.login.helpers({
    ifLogged: function(user) {
        if(user != null) {
            $('#panel-login').hide();
        }
    }
});

// Trim the input
var trimInput = function(val) {
    return val.replace(/^\s*|\s*$/g, "");
};

// Check for empty fields
isNotEmpty = function(value) {
    if(value && value !== "") {
        return true;
    }
    sAlert.error('Please fill all the fields');
    return false;
};

// Validating Email
isEmail = function(value) {
    var filter = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    if(filter.test(value)) {
        return true;
    }
    sAlert.error("Invalid email, please use a valid email address");
    return false;
};

// Check passwords fields
isValidPassword = function(password) {
    if(password.length < 6) {
        sAlert.error("Password must be at least 6 characters");
        return false;
    }
    return true;
}

// Check confirmation password
areValidPasswords = function(password, confirm) {
    if(!isValidPassword(password)) {
        return false;
    }
    if(password !== confirm) {
        sAlert.error("Password do not match");
        return false;
    }
    return true;
};

Here there’s a GIF to show you the problem:

Thanks if someone can help me.