diff --git a/modules/auth/auth.controller.js b/modules/auth/auth.controller.js index 153aeb0..8c8fd71 100644 --- a/modules/auth/auth.controller.js +++ b/modules/auth/auth.controller.js @@ -134,6 +134,7 @@ console.log('COMPROBAMOS IS EXISTE EN NUESTRO SISTEMA', newUser); surname: req.body.surname, entityId: req.body.entityid, accessibility: req.body.accesssibility, + profile: req.body.profile, app_version: appVersion, lastlogin: moment().utc(), }; diff --git a/modules/auth/auth.validations.js b/modules/auth/auth.validations.js index e760e5e..a51d1c6 100644 --- a/modules/auth/auth.validations.js +++ b/modules/auth/auth.validations.js @@ -23,6 +23,7 @@ const RegisterInputType = Joi.object().keys({ surname: Joi.string(), entityid: Joi.string().allow(null), profile_picture: Joi.string().allow(null), + profile: Joi.string().allow(null), }); const LoginOutputType = Joi.object().keys({ diff --git a/modules/auth/user.model.js b/modules/auth/user.model.js index 0af072e..1970123 100644 --- a/modules/auth/user.model.js +++ b/modules/auth/user.model.js @@ -41,6 +41,9 @@ module.exports = function (sequelize, DataTypes) { type: DataTypes.BOOLEAN, defaultValue: true, }, + profile: { + type: DataTypes.STRING, + }, refresh_token: { type: DataTypes.STRING(512), }, diff --git a/modules/auth/user.service.js b/modules/auth/user.service.js index c47ac2c..07ef945 100644 --- a/modules/auth/user.service.js +++ b/modules/auth/user.service.js @@ -68,6 +68,7 @@ const extraMethods = { name: dataUser.name, surname: dataUser.surname, entityId: dataUser.entityId, + profile: dataUser.profile, // password: crypto.createHash('sha512').update(user.phone).digest('hex'), } }).then(([user, created]) => { @@ -98,6 +99,7 @@ const extraMethods = { name: dataUser.name, surname: dataUser.surname, entityId: dataUser.entityId, + profile: 'guest', // password: crypto.createHash('sha512').update(user.phone).digest('hex'), } }).then(([user, created]) => {