var express = require('express');
var router = express.Router();
var TokenService = require('../services/tokenService');

// POST /token/generate
router.post('/', function (req, res) {
  var deviceId = req.body.device;
  var identity = req.body.identity;
  var tokenService = new TokenService();

  var token = tokenService.generate(identity, deviceId)

  res.send({
      success: {
          identity: identity,
          token: token.toJwt()
      }
  });
});

module.exports = router;

@@ -364,31 +364,8 @@
 d(%7B%0A
-      success: %7B%0A      
     
@@ -384,22 +384,16 @@
 entity,%0A
-      
     toke
@@ -413,16 +413,8 @@
 t()%0A
-      %7D%0A
   %7D)

Fix token generation feature