Commit ff76f879 by Mine ArithmeticOp

valid status

parent 4e0ab7d7
......@@ -32,14 +32,12 @@ function authCheck(client_id, token, password, callback) {
// console.log('result : ' + util.inspect(res.result, false, null, true))
if (res.result) {
var token_profile = (res && res.result && res.result[0]) ? res.result[0] : {};
console.log('token_profile: ' + util.inspect(token_profile, false, null, true))
var mqttauth = {
clientid: client_id,
token: token,
password: password
};
console.log('mqttauth: ' + util.inspect(mqttauth, false, null, true))
callback(validator.auth_connect(mqttauth, token_profile));
callback(validator.auth_connect(mqttauth, token_profile).status);
}
else {
callback(false);
......
......@@ -33,9 +33,6 @@ function auth_connect(mqttauth, token_profile) {
if (token_profile.for) {
var found = false;
for (var i=0; i<token_profile.for.length; i++) {
console.log(token_profile.for[i].clientid)
console.log(mqttauth.clientid)
console.log(token_profile.for[i].clientid == mqttauth.clientid)
if (token_profile.for[i].clientid == mqttauth.clientid) {
found = true;
break;
......
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