.
This commit is contained in:
parent
2f21d8d2cd
commit
afb5d0883c
@ -45,7 +45,6 @@ passport.use('local-email', new LocalStrategy(localEmailOptions, async (email, p
|
|||||||
if (_.isNull(user)) {
|
if (_.isNull(user)) {
|
||||||
return done(null, false, { message: 'User not found' })
|
return done(null, false, { message: 'User not found' })
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var password_encoded = crypto.createHash('sha512').update(password).digest('hex');
|
var password_encoded = crypto.createHash('sha512').update(password).digest('hex');
|
||||||
const isPasswordValid = await user.comparePassword(password_encoded);
|
const isPasswordValid = await user.comparePassword(password_encoded);
|
||||||
if (!isPasswordValid) {
|
if (!isPasswordValid) {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ const AccessValidator = require('../../middlewares/accessValidator');
|
|||||||
//const { ModelHandler } = require('sequelize-handlers');
|
//const { ModelHandler } = require('sequelize-handlers');
|
||||||
//const postHandler = new ModelHandler(models.Post);
|
//const postHandler = new ModelHandler(models.Post);
|
||||||
|
|
||||||
|
// [ADMIN] - LogiN
|
||||||
routes.post('/auth',
|
routes.post('/auth',
|
||||||
SchemaValidator(authValidation.LoginWinEmailInputType, true),
|
SchemaValidator(authValidation.LoginWinEmailInputType, true),
|
||||||
AccessValidator.isRegisteredUserEmail,
|
AccessValidator.isRegisteredUserEmail,
|
||||||
|
|||||||
@ -7,7 +7,6 @@ const extraMethods = {
|
|||||||
findUser: async (params, context) => {
|
findUser: async (params, context) => {
|
||||||
return await models.User.findOne({
|
return await models.User.findOne({
|
||||||
where: params,
|
where: params,
|
||||||
raw: true, // <- para evitar tener que hacer .toJson al final
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user