Better hiding of passwords, hiding cookie-logins better

This commit is contained in:
Kasper Rynning-Tønnesen
2018-09-26 22:33:33 +02:00
parent 7ab5d4f399
commit c136199269
9 changed files with 140 additions and 75 deletions

View File

@@ -698,8 +698,10 @@ module.exports = function() {
Functions.getSessionAdminUser(Functions.getSession(socket), coll, function(userpass, adminpass) {
if(userpass != "" || obj.pass == undefined) {
obj.pass = userpass;
} else {
obj.pass = crypto.createHash('sha256').update(Functions.decrypt_string(obj.pass)).digest("base64")
}
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (obj.hasOwnProperty('pass') && docs[0].userpass == crypto.createHash('sha256').update(Functions.decrypt_string(obj.pass)).digest("base64")))) {
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (obj.hasOwnProperty('pass') && docs[0].userpass == obj.pass))) {
Functions.check_inlist(coll, guid, socket, offline, undefined, "place 4");
List.send_play(coll, socket);
} else {