mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Fix eslint errors
This commit is contained in:
parent
a875d85c46
commit
b60cb6ef6a
7 changed files with 49 additions and 35 deletions
|
@ -14,8 +14,8 @@ module.exports = {
|
|||
function accessTokenAuth(req, res, next) {
|
||||
if (req.headers.authorization) {
|
||||
var authHeader = req.headers.authorization.split(' ')
|
||||
, format = authHeader[0]
|
||||
, tokenId = authHeader[1]
|
||||
var format = authHeader[0]
|
||||
var tokenId = authHeader[1]
|
||||
|
||||
if (format !== 'Bearer') {
|
||||
return res.status(401).json({
|
||||
|
@ -42,7 +42,7 @@ function accessTokenAuth(req, res, next) {
|
|||
}
|
||||
|
||||
var jwt = token.jwt
|
||||
, data = jwtutil.decode(jwt, req.options.secret)
|
||||
var data = jwtutil.decode(jwt, req.options.secret)
|
||||
|
||||
if (!data) {
|
||||
return res.status(500).json({
|
||||
|
@ -54,7 +54,8 @@ function accessTokenAuth(req, res, next) {
|
|||
if (user) {
|
||||
req.user = user
|
||||
next()
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return res.status(500).json({
|
||||
success: false
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue