Compare commits

..

No commits in common. "b891d8f516916c58779bd646e68c88ac40069e63" and "90c5362a5726b194a6f543a94bc2dd956907e2f7" have entirely different histories.

View File

@ -127,8 +127,8 @@ const authorization = {
Users.findById (req.body.user) .exec (function (err, entry) {
// If there is a local user AND it has a password associated, test against this, and only this
if (entry != null && entry.pwd) {
console.info(entry);
if (crypto.checkLocalAuth (entry, req.body.pwd)) {
console.info(entry.roles);
return fillSession (req, entry, entry.roles, returnSession);
}
return returnError ();
@ -151,7 +151,7 @@ const authorization = {
entry.type = found.type;
if (! entry.orclgender || entry.orclgender === "")
entry.orclgender = found.orclgender;
return fillSession (req, entry, entry.roles.length > 0 ? entry.roles : {user:true}, returnSession);
return fillSession (req, entry, entry.roles.length > 0 ? common.arrayToHash(entry.roles) : {user:true}, returnSession);
}
// Otherwise create standard user entry