mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Fix eslint errors
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user