Commit 56021c2a by zCaesar

fix error

parent 045aaf2a
......@@ -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();
}
}
......
......@@ -113,15 +113,15 @@ module.exports = function (options = {}) {
// "result": "ok"
// });
// } else {
// res.send({
// "result": "no"
// });
// res.send({
// result: { error: 'not allowed' }
// });
// }
// })
// } else {
// res.send({
// "result": "no"
// });
// res.send({
// result: {error: 'not allowed'}
// });
// }
// // const util = require('util')
// // console.log(util.inspect(status, false, null, true))
......@@ -136,18 +136,18 @@ module.exports = function (options = {}) {
// "result": "ok"
// });
// } else {
// res.send({
// "result": "no"
// });
// res.send({
// result: {error: 'not allowed'}
// });
// }
// })
// } else {
// res.send({
// "result": "no"
// });
// res.send({
// result: {error: 'not allowed'}
// });
// }
// }
on_register_redis(req.body.client_id).then(status => {
console.log('redis:status: ' + status)
if (status) {
......@@ -156,7 +156,7 @@ module.exports = function (options = {}) {
});
} else {
res.send({
"result": { 'error': "not allowed" }
result: { error: 'not allowed' }
});
}
})
......@@ -164,7 +164,7 @@ module.exports = function (options = {}) {
}
else {
res.send({
"result": "no"
result: { error: 'not allowed' }
});
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();
}
}
......
......@@ -5,6 +5,8 @@ module.exports = function (options = {}) {
return function (req, res, next) {
console.log('auth_on_offline')
doRedis(req.body.client_id)
res.status(200);
res.send('');
}
function doRedis(client_id) {
......
......@@ -13,7 +13,7 @@ module.exports = function(options = {}) {
if (decoded.role === 'realtimedb') {
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