login fixed

This commit is contained in:
Marc Wäckerlin
2017-03-14 10:59:11 +00:00
parent f6ed33dad1
commit 18a92c7f40
5 changed files with 1864 additions and 11 deletions

View File

@@ -13,12 +13,12 @@ module.exports = function(app, io, authentication) {
authenticate: function (socket, data, callback) {
console.log("=> authenticate: ", data.username);
authentication(data.username, data.password,
function() {
console.log("####LOGIN-SUCESS####");
function(username) {
console.log("user logged in", username);
callback(null, true)
},
function() {
console.log("####LOGIN-FAIL####");
function(username, where, err) {
console.log("login failed", username, where, err);
callback(new Error("wrong credentials"))
});
},