Skip to content
Snippets Groups Projects
Commit 52255153 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

move hash update later in authenticate_user call, as session cookie must be...

move hash update later in authenticate_user call, as session cookie must be updated for bcrypt hash update to succeed.
parent 588e329a
No related branches found
No related tags found
No related merge requests found
...@@ -70,15 +70,15 @@ exports.process = function(req, res) { ...@@ -70,15 +70,15 @@ exports.process = function(req, res) {
config.get('ephemeral_session_duration_ms') config.get('ephemeral_session_duration_ms')
: config.get('authentication_duration_ms') : config.get('authentication_duration_ms')
}, function(err) { }, function(err) {
if (err) if (err)
return wsapi.databaseDown(res, err); return wsapi.databaseDown(res, err);
res.json({ success: true, userid: uid }); res.json({ success: true, userid: uid });
// if the work factor has changed, update the hash here. issue #204
// NOTE: this runs asynchronously and will not delay the response
if (config.get('bcrypt_work_factor') != bcrypt.getRounds(hash))
updateHash(req, res, uid, hash);
}); });
// if the work factor has changed, update the hash here. issue #204
// NOTE: this runs asynchronously and will not delay the response
if (config.get('bcrypt_work_factor') != bcrypt.getRounds(hash))
updateHash(req, res, uid, hash);
} }
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment