diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 4612226d59..90a1715cbb 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -319,7 +319,7 @@ authenticationController.onSuccessfulLogin = function (req, uid, callback) { user.auth.addSession(uid, req.sessionID, next); }, function (next) { - db.setObjectField('uid:' + uid + 'sessionUUID:sessionId', uuid, req.sessionID, next); + db.setObjectField('uid:' + uid + ':sessionUUID:sessionId', uuid, req.sessionID, next); }, function (next) { user.updateLastOnlineTime(uid, next); diff --git a/test/authentication.js b/test/authentication.js index e3ab49a5f5..fb26e0bfbf 100644 --- a/test/authentication.js +++ b/test/authentication.js @@ -120,7 +120,12 @@ describe('authentication', function () { assert(body); assert.equal(body.username, 'regular'); assert.equal(body.email, 'regular@nodebb.org'); - done(); + db.getObject('uid:' + regularUid + ':sessionUUID:sessionId', function (err, sessions) { + assert.ifError(err); + assert(sessions); + assert(Object.keys(sessions).length > 0); + done(); + }); }); }); });