After a forced update, the page is thrown onto the login form, although the session is not lost and user data from the console.

router.js

Router.map(function() { this.route('main', {path: '/'}); this.route('work', {path: '/work'}); this.route('/depart', { path: '/depart', name: 'depart', template: 'depart', waitOn: function() { return [ Meteor.subscribe('departs') ]; }, subscriptions: function(){ return Meteor.subscribe('departs'); } }); 

On the problematic template main.html , a check is used if the user is logged in and if not, it shows the login template.

 <template name = "main"> {{#if currentUser}} Main Engine {{else}} {{> login}} {{/if}} </template> 

What could be? I read somewhere that supposedly when updating the page, the meteor believes that this is a new session, but why then does the user remain logged in?

    1 answer 1

    The problem was completely different, the main template displays information that uses the server method of the meteor and the http package to access the third-party api service. To display this information, I used the reactive-var package, which, when updating the page, produced errors and led to unstable operation. Instead, he began to use the package simple: reactive-method

     depart: function () { return ReactiveMethod.call('getFdb'); } 

    And everything works stably.