spee.ch/server/routes/auth/index.js
2018-11-12 14:31:34 -05:00

12 lines
631 B
JavaScript

const speechPassport = require('../../speechPassport');
const handleSignupRequest = require('../../controllers/auth/signup');
const handleLoginRequest = require('../../controllers/auth/login');
const handleLogoutRequest = require('../../controllers/auth/logout');
const handleUserRequest = require('../../controllers/auth/user');
module.exports = {
'/signup': { method: 'post', controller: [ speechPassport.authenticate('local-signup'), handleSignupRequest ] },
'/auth' : { method: 'post', controller: handleLoginRequest },
'/logout': { controller: handleLogoutRequest },
'/user' : { controller: handleUserRequest },
};