mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-08 01:00:31 +03:00
test
This commit is contained in:
@@ -22,9 +22,10 @@ module.exports.devices = [
|
||||
(req, res) => {
|
||||
const [reqId, authToken] = [req.get('X-Request-Id'), String(req.get('Authorization')).split(' ')[1]];
|
||||
|
||||
//const ltoken = global.authl.findOne({'token': authToken});
|
||||
//const {userId} = ltoken;
|
||||
console.log(authToken);
|
||||
try {
|
||||
const ltoken = global.authl.findOne({'token': authToken});
|
||||
const {userId} = ltoken;
|
||||
console.log(userId);
|
||||
|
||||
const r = {
|
||||
request_id: reqId,
|
||||
@@ -39,6 +40,10 @@ module.exports.devices = [
|
||||
};
|
||||
|
||||
res.status(200).send(r);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
res.status(404).send(undefined);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
Reference in New Issue
Block a user