This commit is contained in:
David Arranz 2019-07-30 16:22:07 +02:00
parent 4a0ec9809c
commit 5780dacf5e
3 changed files with 20 additions and 1 deletions

View File

@ -38,6 +38,18 @@ async function login(req, res, next) {
}
}
async function login2(req, res, next) {
try {
res.status(httpStatus.OK).json({
// token: tokens.token,
// refreshToken: tokens.refreshToken,
// user: data,
})
} catch (error) {
controllerHelper.handleErrorResponse(MODULE_NAME, login.name, error, res)
}
}
async function register(req, res, next) {
function cleanAdminData(user) {
@ -130,6 +142,7 @@ async function rejectToken(req, res, next) {
module.exports = {
login,
login2,
register,
regenerateToken,
rejectToken,

View File

@ -17,6 +17,12 @@ routes.post('/auth',
authController.login,
);
routes.get('/auth',
// SchemaValidator(authValidation.LoginInputType, true),
// AccessValidator.isRegisteredUserEmail,
authController.login2,
);
routes.post('/register',
SchemaValidator(authValidation.RegisterInputType, true),
AccessValidator.isRegisteredUserPhone,

View File

@ -16,7 +16,7 @@ const generalInvalidFields = [
// Todos los ponentes
routes.get('/speakers',
isLoggedUser,
//isLoggedUser,
FieldMiddleware.middleware({
invalidFields: generalInvalidFields
}),