Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-rest-api-mcafee
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
node-rest-api-mcafee
Commits
96197a74
Commit
96197a74
authored
Nov 04, 2020
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correcion mensaje de error
parent
b5cc244e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
middleware/auth-endpoint-validator.js
middleware/auth-endpoint-validator.js
+3
-3
No files found.
middleware/auth-endpoint-validator.js
View file @
96197a74
...
@@ -7,7 +7,7 @@ module.exports=function(req,res,next){
...
@@ -7,7 +7,7 @@ module.exports=function(req,res,next){
if
(
!
req
.
header
(
'
x-auth-mcafee-token
'
)){
if
(
!
req
.
header
(
'
x-auth-mcafee-token
'
)){
let
error
=
new
Error
(
'
Acceso denegado.No existe un token válido.
'
);
let
error
=
new
Error
(
'
Acceso denegado.No existe un token válido.
'
);
log
.
logger
.
error
(
error
);
log
.
logger
.
error
(
error
);
return
res
.
status
(
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)).
json
({
code
:
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)
,
error
:
error
})
return
res
.
status
(
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)).
json
({
code
:
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)
,
error
:
error
.
message
})
}
}
try
{
try
{
...
@@ -15,7 +15,7 @@ try{
...
@@ -15,7 +15,7 @@ try{
if
(
!
decoded
)
{
if
(
!
decoded
)
{
let
error
=
new
Error
(
'
Token con formato incorrecto.
'
);
let
error
=
new
Error
(
'
Token con formato incorrecto.
'
);
log
.
logger
.
error
(
error
);
log
.
logger
.
error
(
error
);
return
res
.
status
(
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)).
json
({
code
:
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)
,
error
:
error
})
return
res
.
status
(
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)).
json
({
code
:
config
.
get
(
'
constants.HTTP_STATUS_CODE.UNAUTHORIZED
'
)
,
error
:
error
.
message
})
}
}
next
();
next
();
...
@@ -23,7 +23,7 @@ try{
...
@@ -23,7 +23,7 @@ try{
}
catch
(
ex
){
}
catch
(
ex
){
let
error
=
new
Error
(
'
Token Inválido
'
);
let
error
=
new
Error
(
'
Token Inválido
'
);
log
.
logger
.
error
(
error
);
log
.
logger
.
error
(
error
);
res
.
status
(
config
.
get
(
'
constants.HTTP_STATUS_CODE.BAD_REQUEST
'
)).
json
({
code
:
config
.
get
(
'
constants.HTTP_STATUS_CODE.BAD_REQUEST
'
)
,
error
:
error
});
res
.
status
(
config
.
get
(
'
constants.HTTP_STATUS_CODE.BAD_REQUEST
'
)).
json
({
code
:
config
.
get
(
'
constants.HTTP_STATUS_CODE.BAD_REQUEST
'
)
,
error
:
error
.
message
});
}
}
}
}
\ 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