Meteor.logout not working when wifi is off

The issue i am facing is when trying to logout out the application when running it locally on my machine, basically to describe it briefly the Meteor.logout() works perfectly when i have an internet connection, however if i turn off the internet connection Meteor.logout() does seem to work at first as i have a redirect function in its callback the gets called, but then if i try to navigate to a page where i have a navigation guard on its navigates successfully and the user is logged in again as if nothing happened. This issue however as i stated doesn’t happen if i am connected to the internet. Is there any reason why the Meteor.logout() is not committing when there is no internet connection. Thanks in advance.

Because this is the function logout, you can find it in this file: https://github.com/meteor/meteor/blob/devel/packages/accounts-base/accounts_client.js

logout(callback) {
    this._loggingOut.set(true);
    this.connection.apply('logout', [], {
      wait: true
    }, (error, result) => {
      this._loggingOut.set(false);
      if (error) {
        callback && callback(error);
      } else {
        this.makeClientLoggedOut();
        callback && callback();
      }
    });
  }

Because of no internet connection, this line will not be executed

this.makeClientLoggedOut();
2 Likes