'use strict';

const User = require('../models/User');

module.exports = async (config, cli) => {
  cli.logLogo();
  cli.sessionStart('logging out', { timer: false });

  const user = new User();

  if (!user.isLoggedIn()) {
    cli.sessionStop('you are already logged out');
    return null;
  }

  user.logout();

  cli.sessionStop('logout successful');
};
