Take Some Server actions on Client logout?[SOLVED]

 logout(callback) {
    var self = this;
    self.connection.apply('logout', [], {
      wait: true
    }, function (error, result) {
      if (error) {
        callback && callback(error);
      } else {
        callback && callback();

That is the code for logging out on the client. I see it calls some ‘logout’ method on the server

How do I ‘get the method’ i.e do something that method is called, without creating a new logout Method or custom logout method.


Meteor.default_server.method_handlers['logout'] = function () {
    let accounts = Accounts
    var token = accounts._getLoginToken(this.connection.id);
    accounts._setLoginToken(this.userId, this.connection, null);
    if (token && this.userId) accounts.destroyToken(this.userId, token);
    accounts._successfulLogout(this.connection, this.userId);

Can I do my own things here ??


This is the server code to logging out . I am going to update it to serve my other purposes. . Those this 'Make sense ’