diff --git a/index.js b/index.js index 469c92c..d6eb59d 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -var auth = require('./src/auth.middleware'); +const auth = require('./src/auth.middleware'); module.exports = { auth diff --git a/src/auth.middleware.js b/src/auth.middleware.js index 5747934..fdae92b 100644 --- a/src/auth.middleware.js +++ b/src/auth.middleware.js @@ -1,9 +1,9 @@ -var admin = require.main.require('firebase-admin'); +const admin = require.main.require('firebase-admin'); -var logger = require('./util/logger'); +const logger = require('./util/logger'); function firebaseAuthMiddleware(req, res, next) { - let authorization = req.header('Authorization'); + const authorization = req.header('Authorization'); if (authorization) { let token = authorization.split(' '); admin.auth().verifyIdToken(token[1]) diff --git a/src/util/logger.js b/src/util/logger.js index 77ffed2..2413844 100644 --- a/src/util/logger.js +++ b/src/util/logger.js @@ -1,9 +1,9 @@ -var debug = (process.env.APP_DEBUG === 'true'); +const debug = (process.env.APP_DEBUG === 'true'); function log() { if (!debug) return; - console.log.apply(null, arguments); + console.log(...arguments); } module.exports = {