export const get = (req, res) => {
  // NOTE: we could also set authenticated in models.User.auth but this is more of a
  // UI level variable than an authentication variable.  If the code gets to this
  // point then the get.authenticated passed and the user has to be authenticated.
  const reply = {
    id: req.user.id,
    initials: req.user.initials,
    full_name: req.user.full_name,
    admin: req.user.admin,
    email: req.user.email,
    discord_sent: req.user.discord_sent,
    unsubscribe: req.user.unsubscribe,
    authenticated: true
  }
  res.status(200).json(reply);
}

get.authenticated = true;

export const post = (req, res) => {
  const reply = {
    id: req.user.id,
    initials: req.user.initials,
    full_name: req.user.full_name,
    admin: req.user.admin,
    email: req.user.email,
    unsubscribe: req.user.unsubscribe,
    discord_sent: req.user.discord_sent,
    authenticated: true
  }
  res.status(200).json(reply);
}

// this flags it as a login endpoint expecting a username/password
post.login = true;
