applay-utils 1.2.13 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applay-utils",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "Utilitary tools for Applay applications",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/utils/jwt.js CHANGED
@@ -13,15 +13,7 @@ var utils = {
13
13
  if (!key) return res.status(401).json({ auth: false, message: 'Sem key definida.' });
14
14
  jwt.verify(token, key, (err, decoded) => {
15
15
  if (err) return res.status(401).json({ auth: false, message: 'Falha na autenticação do token.' });
16
- req.userId = decoded.id.split('#')[0];
17
- var cfgSystem = cfg.systems[req.hostname];
18
- if (!cfgSystem) {
19
- console.log('req.hostname', req.hostname);
20
- return res.status(404).send({ msg: 'Hostname não encontrado', status: false, code: 404 });
21
- }
22
- if (cfgSystem.alias != decoded.id.split('#')[1]) {
23
- return res.status(401).json({ auth: false, message: 'Alias diferente do token.' });
24
- }
16
+ req.tokenId = decoded.id;
25
17
  next();
26
18
  });
27
19
  },
package/utils/mdb.js CHANGED
@@ -1,5 +1,6 @@
1
1
  var MongoBase = require('mongodb');
2
2
  var ObjectId = require('mongodb').ObjectId;
3
+ var ObjectID = ObjectId;
3
4
 
4
5
  var MDB = {
5
6
  status: {},
@@ -206,7 +207,7 @@ function build(data, model, user) {
206
207
 
207
208
  module.exports = {
208
209
  ObjectId,
209
- ObjectID: ObjectId,
210
+ ObjectID,
210
211
  connect,
211
212
  connectAsync,
212
213
  stopCustom,