tuiHoneyPot

front and back end of my TUI honeypot
Log | Files | Refs | README

logout.js (547B)


      1 
      2 window.FakeTerminal.command.logout = function (instance) {
      3     window.FakeTerminal.command.apply(this, arguments);
      4 
      5     const base = this;
      6 
      7     base.info = () => {
      8         return {
      9             description: "Logout of the current session"
     10         }
     11     }
     12 
     13     base.execute = async () => {
     14         destroyStorage();
     15 
     16         if (! await logout()) {
     17             instance.output.write("Could not logout!");
     18         } else {
     19             window.location = "/";
     20         }
     21 
     22         base.deferred.resolve();
     23         return base.deferred.promise();
     24     }
     25 }