Use single quotes :P

This commit is contained in:
Michael Jackson
2018-12-17 09:38:05 -08:00
parent ada37035cd
commit 19b2e5574b
93 changed files with 792 additions and 791 deletions

View File

@ -4,8 +4,8 @@
*/
function requireAuth(scope) {
let checkScopes;
if (scope.includes(".")) {
const parts = scope.split(".");
if (scope.includes('.')) {
const parts = scope.split('.');
checkScopes = scopes =>
parts.reduce((memo, part) => memo && memo[part], scopes) != null;
} else {
@ -20,11 +20,11 @@ function requireAuth(scope) {
const user = req.user;
if (!user) {
return res.status(403).send({ error: "Missing auth token" });
return res.status(403).send({ error: 'Missing auth token' });
}
if (!user.scopes || !checkScopes(user.scopes)) {
return res.status(403).send({ error: "Insufficient scopes" });
return res.status(403).send({ error: 'Insufficient scopes' });
}
if (req.auth) {