chore: commit lint fixes for the api
This commit is contained in:
committed by
mrugesh mohapatra
parent
010fa63e76
commit
07266b7e43
@ -3,7 +3,7 @@ import helmet from 'helmet';
|
||||
import { homeLocation } from '../../../config/env';
|
||||
|
||||
let trusted = [
|
||||
"'self'",
|
||||
'\'self\'',
|
||||
'https://search.freecodecamp.org',
|
||||
homeLocation,
|
||||
'https://' + process.env.AUTH0_DOMAIN
|
||||
@ -31,8 +31,8 @@ export default function csp() {
|
||||
'https://*.algolia.net'
|
||||
]),
|
||||
scriptSrc: [
|
||||
"'unsafe-eval'",
|
||||
"'unsafe-inline'",
|
||||
'\'unsafe-eval\'',
|
||||
'\'unsafe-inline\'',
|
||||
'*.google-analytics.com',
|
||||
'*.gstatic.com',
|
||||
'https://*.cloudflare.com',
|
||||
@ -48,7 +48,7 @@ export default function csp() {
|
||||
'*.ytimg.com'
|
||||
].concat(trusted),
|
||||
styleSrc: [
|
||||
"'unsafe-inline'",
|
||||
'\'unsafe-inline\'',
|
||||
'*.gstatic.com',
|
||||
'*.googleapis.com',
|
||||
'*.bootstrapcdn.com',
|
||||
|
@ -69,15 +69,15 @@ export default () => function authorizeByJWT(req, res, next) {
|
||||
if (!req.user) {
|
||||
const User = loopback.getModelByType('User');
|
||||
return User.findById(userId)
|
||||
.then(user => {
|
||||
if (user) {
|
||||
user.points = user.progressTimestamps.length;
|
||||
req.user = user;
|
||||
}
|
||||
return;
|
||||
})
|
||||
.then(next)
|
||||
.catch(next);
|
||||
.then(user => {
|
||||
if (user) {
|
||||
user.points = user.progressTimestamps.length;
|
||||
req.user = user;
|
||||
}
|
||||
return;
|
||||
})
|
||||
.then(next)
|
||||
.catch(next);
|
||||
} else {
|
||||
return next();
|
||||
}
|
||||
|
Reference in New Issue
Block a user