<commit_before>var express   = require('express')
  , passport  = require('passport')
  , users     = require('../controllers/user-controller')
  , stratergy = require('../controllers/passport')
  , router    = express.Router();

router.get('/auth', function(request, response){
    response.render('auth', { message : request.flash('error') });
});

router.post('/auth', passport.authenticate('signin',
    { successRedirect : '/#/dashboard'
    , failureRedirect : '/auth'
    , failureFlash    : true
    })
);

router.post('/api/signup', function(request, response, next){
    passport.authenticate('signup', function(err, user, info){

        if(err || info)
            return response.json(405, err || info.message);

        return response.json(user);
    })(request, response, next);
});

module.exports = router;<commit_msg>added route to check authentication<commit_after>var express   = require('express')
  , passport  = require('passport')
  , users     = require('../controllers/user-controller')
  , stratergy = require('../controllers/passport')
  , router    = express.Router();

router.get('/isAuthenticated', function(request, response){
    response.send(request.isAuthenticated() ? request.user : 0);
});

router.get('/auth', function(request, response){
    response.render('auth', { message : request.flash('error') });
});

router.post('/auth', passport.authenticate('signin',
    { successRedirect : '/#/dashboard/overview'
    , failureRedirect : '/auth'
    , failureFlash    : true
    })
);

router.post('/api/signup', function(request, response, next){
    passport.authenticate('signup', function(err, user, info){

        if(err || info)
            return response.json(405, err || info.message);

        return response.json(user);
    })(request, response, next);
});

module.exports = router;
{'fraction_non_alphanumeric': 0.1756683033278778, 'fraction_numerical': 0.0038188761593016913, 'mean_word_length': 3.739018087855297, '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': '7574861', 'n_tokens_mistral': 550, 'n_tokens_neox': 528, 'n_words': 101}