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
ff76f879
Commit
ff76f879
authored
Oct 31, 2018
by
Mine ArithmeticOp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
valid status
parent
4e0ab7d7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
6 deletions
+1
-6
authhook/auth_on_register.js
+1
-3
authhook/validator.js
+0
-3
No files found.
authhook/auth_on_register.js
View file @
ff76f879
...
@@ -32,14 +32,12 @@ function authCheck(client_id, token, password, callback) {
...
@@ -32,14 +32,12 @@ function authCheck(client_id, token, password, callback) {
// console.log('result : ' + util.inspect(res.result, false, null, true))
// console.log('result : ' + util.inspect(res.result, false, null, true))
if
(
res
.
result
)
{
if
(
res
.
result
)
{
var
token_profile
=
(
res
&&
res
.
result
&&
res
.
result
[
0
])
?
res
.
result
[
0
]
:
{};
var
token_profile
=
(
res
&&
res
.
result
&&
res
.
result
[
0
])
?
res
.
result
[
0
]
:
{};
console
.
log
(
'token_profile: '
+
util
.
inspect
(
token_profile
,
false
,
null
,
true
))
var
mqttauth
=
{
var
mqttauth
=
{
clientid
:
client_id
,
clientid
:
client_id
,
token
:
token
,
token
:
token
,
password
:
password
password
:
password
};
};
console
.
log
(
'mqttauth: '
+
util
.
inspect
(
mqttauth
,
false
,
null
,
true
))
callback
(
validator
.
auth_connect
(
mqttauth
,
token_profile
).
status
);
callback
(
validator
.
auth_connect
(
mqttauth
,
token_profile
));
}
}
else
{
else
{
callback
(
false
);
callback
(
false
);
...
...
authhook/validator.js
View file @
ff76f879
...
@@ -33,9 +33,6 @@ function auth_connect(mqttauth, token_profile) {
...
@@ -33,9 +33,6 @@ function auth_connect(mqttauth, token_profile) {
if
(
token_profile
.
for
)
{
if
(
token_profile
.
for
)
{
var
found
=
false
;
var
found
=
false
;
for
(
var
i
=
0
;
i
<
token_profile
.
for
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
token_profile
.
for
.
length
;
i
++
)
{
console
.
log
(
token_profile
.
for
[
i
].
clientid
)
console
.
log
(
mqttauth
.
clientid
)
console
.
log
(
token_profile
.
for
[
i
].
clientid
==
mqttauth
.
clientid
)
if
(
token_profile
.
for
[
i
].
clientid
==
mqttauth
.
clientid
)
{
if
(
token_profile
.
for
[
i
].
clientid
==
mqttauth
.
clientid
)
{
found
=
true
;
found
=
true
;
break
;
break
;
...
...
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