Se añade 'profile' al usuario para guardar si es estudiante, tutor, invitado o libre.
This commit is contained in:
parent
0e4489c72f
commit
0ebcd4abd7
@ -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(),
|
||||
};
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -41,6 +41,9 @@ module.exports = function (sequelize, DataTypes) {
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: true,
|
||||
},
|
||||
profile: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
refresh_token: {
|
||||
type: DataTypes.STRING(512),
|
||||
},
|
||||
|
||||
@ -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]) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user