<commit_before>'use strict';

var auth = require('app/util/auth');
//var logger_module = require('app/util/logger');
//var logger = logger_module.get('app/api/session/router_impl');

module.exports = {
  /**
   * Returns user description - assumes that the requester must be logged in to access this API endpoint
   */
  get_user: function(pr, req, res, next) {
    var result = {
      email: req.user.email,
      signup_date: req.user.sq_created_at
    };
    res.status(200).send(result);
  },

  /**
   * Logs user out and destroys session (the logic for this: if they're logging out then in user's mind this session
   * is over)
   */
  logout: function(req, res, next) {
    req.logout();
    req.session.destroy();
    req.flash('message', 'Logged out');
    res.redirect('/api/util/success');<commit_msg>server/app/api/user/router_impl.js - no flash message on logout because session destroyed<commit_after>'use strict';

var auth = require('app/util/auth');
//var logger_module = require('app/util/logger');
//var logger = logger_module.get('app/api/session/router_impl');

module.exports = {
  /**
   * Returns user description - assumes that the requester must be logged in to access this API endpoint
   */
  get_user: function(pr, req, res, next) {
    var result = {
      email: req.user.email,
      signup_date: req.user.sq_created_at
    };
    res.status(200).send(result);
  },

  /**
   * Logs user out and destroys session (the logic for this: if they're logging out then in user's mind this session
   * is over)
   */
  logout: function(req, res, next) {
    req.logout();
    req.session.destroy();
    // No req.flash message because we just destroyed the session: req.flash('message', 'Logged out');
    res.redirect('/api/util/success');
{'fraction_non_alphanumeric': 0.13921901528013583, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 3.3227383863080684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3384792', 'n_tokens_mistral': 558, 'n_tokens_neox': 545, 'n_words': 160}