spee.ch/routes/auth-routes.js

16 lines
455 B
JavaScript
Raw Normal View History

2017-09-20 23:39:20 +02:00
const logger = require('winston');
const passport = require('passport');
module.exports = (app) => {
// route for sign up
app.post('/signup', passport.authenticate('local-signup'), (req, res) => {
logger.debug('successful signup');
res.status(200).json(true);
});
// route for log in
app.post('/login', passport.authenticate('local-login'), (req, res) => {
logger.debug('successful login');
res.status(200).json(true);
});
};