Commit 539268ab by zCaesar

can get group

parent 9390b5c1
...@@ -3,10 +3,10 @@ module.exports.getGroupID = getGroupID ...@@ -3,10 +3,10 @@ module.exports.getGroupID = getGroupID
var config = require('config'); var config = require('config');
var seneca = require('seneca')({log: 'silent'}).client({ port: config.get('device_registry_port'), host: config.get('device_registry_host') }); var seneca = require('seneca')({log: 'silent'}).client({ port: config.get('device_registry_port'), host: config.get('device_registry_host') });
var getRole = require('../checkClientRole').getRole // var getRole = require('../checkClientRole').getRole
function getGroupID(token, client_id, callback) { function getGroupID(token, client_id, callback) {
var role = getRole(token); var role = require('jwt-verify').verify(token).res
if (role && role.hasOwnProperty('groupId')) { if (role && role.hasOwnProperty('groupId')) {
callback(role.groupId); callback(role.groupId);
} }
......
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