Skip to content

Commit

Permalink
refactor code to es6
Browse files Browse the repository at this point in the history
  • Loading branch information
antonybudianto committed Mar 4, 2017
1 parent 1f6d158 commit c5313a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var auth = require('./src/auth.middleware');
const auth = require('./src/auth.middleware');

module.exports = {
auth
Expand Down
6 changes: 3 additions & 3 deletions src/auth.middleware.js
Original file line number Diff line number Diff line change
@@ -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])
Expand Down
4 changes: 2 additions & 2 deletions src/util/logger.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down

0 comments on commit c5313a9

Please sign in to comment.