Compare commits
2 Commits
90c5362a57
...
b891d8f516
Author | SHA1 | Date | |
---|---|---|---|
b891d8f516 | |||
0a3a45107a |
@ -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 ? common.arrayToHash(entry.roles) : {user:true}, returnSession);
|
||||
return fillSession (req, entry, entry.roles.length > 0 ? entry.roles : {user:true}, returnSession);
|
||||
}
|
||||
|
||||
// Otherwise create standard user entry
|
||||
|
Loading…
x
Reference in New Issue
Block a user