node-express-woodevice
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -5,2 +5,3 @@ const config = require('./config'); | ||
const deviceModel = require('./src/repositories/models/device'); | ||
const authTokenHandler = require('woo-utilities/authTokenHandler'); | ||
@@ -14,2 +15,6 @@ const init = ({ | ||
config.iysContentFunc = iysContentFunc; | ||
authTokenHandler.init({ | ||
publicKey, privateKey | ||
}); | ||
} | ||
@@ -16,0 +21,0 @@ |
{ | ||
"name": "node-express-woodevice", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -20,4 +20,4 @@ "main": "index.js", | ||
"woo-crypto": "^1.0.1", | ||
"woo-utilities": "^1.0.3" | ||
"woo-utilities": "^1.0.5" | ||
} | ||
} | ||
} |
const returnModel = require('woo-utilities/returnModel'); | ||
const AsyncRouter = require('express-async-router').AsyncRouter; | ||
const authToken = require('../handlers/authToken'); | ||
const authToken = require('woo-utilities/authTokenHandler'); | ||
const token = require('../constants/token'); | ||
@@ -11,3 +11,3 @@ const deviceRepo = require('../repositories/device'); | ||
router.post('/insert', authToken(token.DEVICE_INSERT), async (req, res) => { | ||
router.post('/insert', authToken.handler(token.DEVICE_INSERT), async (req, res) => { | ||
// req.body.device, req.body.keys, req.body.os | ||
@@ -61,3 +61,3 @@ var device = await deviceRepo.findByDevice(req.body.device); | ||
router.post('/keyinfo', authToken(token.DEVICE_KEY), async (req, res) => { | ||
router.post('/keyinfo', authToken.handler(token.DEVICE_KEY), async (req, res) => { | ||
var keyInfo = config.keyInfoFunc ? await config.keyInfoFunc(req.body.os) : {}; | ||
@@ -64,0 +64,0 @@ |
5469
8
157
Updatedwoo-utilities@^1.0.5