Skip to content

Commit

Permalink
Update increment ID to UUID in mqtt adapter
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
  • Loading branch information
Aleksandar Novakovic committed Dec 4, 2018
1 parent fbe7725 commit 838bf4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mqtt/mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ aedes.authorizePublish = function (client, packet, publish) {
var channelId = channel[1],
accessReq = {
token: client.password,
chanID: Number(channelId)
chanID: channelId
},
onAuthorize = function (err, res) {
var rawMsg;
Expand Down Expand Up @@ -126,10 +126,11 @@ aedes.authorizePublish = function (client, packet, publish) {

aedes.authorizeSubscribe = function (client, packet, subscribe) {
// Topics are in the form `channels/<channel_id>/messages`
var channel = packet.topic.split('/')[1],
var channel = /^channels\/(.+?)\/messages$/.exec(packet.topic),
channelId = channel[1],
accessReq = {
token: client.password,
chanID: Number(channel)
chanID: channelId
},
onAuthorize = function (err, res) {
if (!err) {
Expand Down

0 comments on commit 838bf4e

Please sign in to comment.