Commit 7c17c7be by zCaesar

Merge branch 'redis' into 'master'

edit-auth

See merge request !10
parents 96951290 aac8e7d2
......@@ -30,15 +30,15 @@ function authCheck(client_id, token, password, callback) {
console.log('token :' + token)
seneca.act('ms:tokenregistry, cmd:getAttributes, type:device, tokencode:' + token, function (err, res) {
console.log('result : ' + util.inspect(res.result, false, null, true))
if (res.result) {
if (res.result.length > 0) {
console.log(res.result)
var token_profile = (res && res.result && res.result[0]) ? res.result[0] : {};
var token_profile = (res && res.result) ? res.result : {};
var mqttauth = {
clientid: client_id,
token: token,
password: password
};
console.log(util.inspect(validator.auth_connect(mqttauth, token_profile), false, null, true))
console.log('validator:', util.inspect(validator.auth_connect(mqttauth, token_profile), false, null, true))
callback(validator.auth_connect(mqttauth, token_profile).status);
}
else {
......
......@@ -2,7 +2,7 @@
"device_registry_host" : "alpha.nexpie.io",
"device_registry_port" : 8990,
"token_registry_host" : "alpha.nexpie.io",
"token_registry_host" : "localhost",
"token_registry_port" : 8790,
"auth_on_register_debug" : true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment