Commit 9c233f79 by Chavee Issariyapat

fix vernemq error when authhook reject client

parent 8ac40526
.DS_Store
node_modules/
config/*.json
*.rdb
......@@ -34,7 +34,7 @@ module.exports = function (options = {}) {
if (decoded) {
if (decoded.role === 'realtimedb') response = { 'result': 'ok' }
else response = { 'result': 'no' }
else response = { result: {error: 'not allowed'} }
res.send(response);
next();
}
......@@ -65,7 +65,7 @@ module.exports = function (options = {}) {
next();
}
else {
res.send({ "result": "no" });
res.send({ result: {error: 'not allowed'} });
next();
}
});
......@@ -75,7 +75,7 @@ module.exports = function (options = {}) {
}
else {
res.send({ "result": "no" });
res.send({ result: {error: 'not allowed'} });
next();
}
}
......
......@@ -109,17 +109,17 @@ module.exports = function (options = {}) {
console.log('redis:status: ' + status)
if (status) {
res.send({
"result": "ok"
result: 'ok'
});
} else {
res.send({
"result": "no"
result: {error: 'not allowed'}
});
}
})
} else {
res.send({
"result": "no"
result: {error: 'not allowed'}
});
}
// const util = require('util')
......@@ -132,17 +132,17 @@ module.exports = function (options = {}) {
console.log('redis:status: ' + status)
if (status) {
res.send({
"result": "ok"
result: 'ok'
});
} else {
res.send({
"result": "no"
result: {error: 'not allowed'}
});
}
})
} else {
res.send({
"result": "no"
result: {error: 'not allowed'}
});
}
}
......@@ -150,7 +150,7 @@ module.exports = function (options = {}) {
}
else {
res.send({
"result": "no"
result: 'no'
});
next();
}
......
......@@ -29,7 +29,7 @@ module.exports = function (options = {}) {
if (decoded) {
if (decoded.role === 'realtimedb') response = { 'result': 'ok' }
else response = { 'result': 'no' }
else response = { result: {error: 'not allowed'} }
res.send(response);
next();
}
......@@ -56,14 +56,14 @@ module.exports = function (options = {}) {
next();
}
else {
res.send({ "result": "no" });
res.send({ result: {error: 'not allowed'} });
next();
}
});
}
}
else {
res.send({ "result": "no" });
res.send({ result: {error: 'not allowed'} });
next();
}
}
......
......@@ -11,9 +11,9 @@ module.exports = function(options = {}) {
if (decoded) {
if (decoded.role === 'realtimedb') {
response = { 'result': 'ok' }
response = { result: 'ok' }
}
else response = { 'result': 'no' }
else response = { result: {error: 'not allowed'} }
res.send(response);
next()
}
......@@ -28,7 +28,7 @@ module.exports = function(options = {}) {
"topics": [_ftopic]
}
}
else response = { 'result': 'no' }
else response = { result: {error: 'not allowed'} }
if (options.debug) {
console.log('on_unsubscribe-------------');
......
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