Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vernemq
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stack
vernemq
Commits
af819036
Commit
af819036
authored
Dec 07, 2018
by
zCaesar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit auth
parent
99c5a125
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
authhook/auth_on_register.js
+3
-3
authhook/config/development.json
+1
-1
authhook/on_offline.js
+1
-2
No files found.
authhook/auth_on_register.js
View file @
af819036
...
...
@@ -30,15 +30,15 @@ function authCheck(client_id, token, password, callback) {
console
.
log
(
'token :'
+
token
)
seneca
.
act
(
'ms:tokenregistry, cmd:getAttributes, type:device, tokencode:'
+
token
,
function
(
err
,
res
)
{
console
.
log
(
'result : '
+
util
.
inspect
(
res
.
result
,
false
,
null
,
true
))
if
(
res
.
result
)
{
if
(
res
.
result
.
length
>
0
)
{
console
.
log
(
res
.
result
)
var
token_profile
=
(
res
&&
res
.
result
&&
res
.
result
[
0
])
?
res
.
result
[
0
]
:
{};
var
token_profile
=
(
res
&&
res
.
result
)
?
res
.
result
:
{};
var
mqttauth
=
{
clientid
:
client_id
,
token
:
token
,
password
:
password
};
console
.
log
(
util
.
inspect
(
validator
.
auth_connect
(
mqttauth
,
token_profile
),
false
,
null
,
true
))
console
.
log
(
'validator:'
,
util
.
inspect
(
validator
.
auth_connect
(
mqttauth
,
token_profile
),
false
,
null
,
true
))
callback
(
validator
.
auth_connect
(
mqttauth
,
token_profile
).
status
);
}
else
{
...
...
authhook/config/development.json
View file @
af819036
...
...
@@ -2,7 +2,7 @@
"device_registry_host"
:
"alpha.nexpie.io"
,
"device_registry_port"
:
8990
,
"token_registry_host"
:
"
alpha.nexpie.io
"
,
"token_registry_host"
:
"
localhost
"
,
"token_registry_port"
:
8790
,
"auth_on_register_debug"
:
true
,
...
...
authhook/on_offline.js
View file @
af819036
...
...
@@ -10,4 +10,4 @@ module.exports = function (options = {}) {
res
.
status
(
200
);
res
.
send
(
''
);
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment