Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/login', function(req, res){
- logger.log('Serving request for url [POST] ' + req.route.path);
- var username = req.body.User;
- var password = req.body.Password;
- /**
- * The following can be replaced by any other form
- * of authentication
- */
- User.validateUser(username, password, function(err, user){
- if(err && !user){
- res.json({
- retStatus : 'failure'
- });
- }else{
- req.session.user = user;
- res.json({
- retStatus : 'success',
- user : user
- });
- }
- });
- });
Add Comment
Please, Sign In to add comment