Autenticación: errores solucionados

This commit is contained in:
Juan Ferrer Toribio 2017-05-22 11:04:37 +02:00
parent 5cfdd51cf4
commit ac3f7c2da0
3 changed files with 25 additions and 2 deletions

View File

@ -17,6 +17,16 @@
}, },
"active": { "active": {
"type": "boolean" "type": "boolean"
},
"email": {
"type": "string",
"required": true
},
"created": {
"type": "date"
},
"updated": {
"type": "date"
} }
}, },
"acls": [ "acls": [

View File

@ -52,11 +52,14 @@ module.exports = function(app) {
return; return;
} }
let where = {username: user}; let where = {id: instance.id};
let userData = { let userData = {
id: instance.id,
username: user, username: user,
password: password, password: password,
email: `${user}@verdnatura.es` email: instance.email,
created: instance.created,
updated: instance.updated
}; };
User.upsertWithWhere(where, userData, login); User.upsertWithWhere(where, userData, login);
} }

View File

@ -17,6 +17,16 @@
}, },
"active": { "active": {
"type": "boolean" "type": "boolean"
},
"email": {
"type": "string",
"required": true
},
"created": {
"type": "date"
},
"updated": {
"type": "date"
} }
}, },
"acls": [ "acls": [