diff --git a/app/routes/home.js b/app/routes/home.js index cf76a10..f2357f0 100644 --- a/app/routes/home.js +++ b/app/routes/home.js @@ -1,8 +1,9 @@ -var express = require('express'); -var router = express.Router(); -var path = require('path'); +const express = require('express'); +const router = express.Router(); +const path = require('path'); +const requireAuth = require('../util/auth').requireAuth; -router.get('/', function(req, res) { +router.get('/', requireAuth(), function(req, res) { res.sendFile(path.join(__dirname, '../../public/views', 'home.html')); }); diff --git a/app/routes/panel.js b/app/routes/panel.js index f1ebd4a..49b7333 100644 --- a/app/routes/panel.js +++ b/app/routes/panel.js @@ -1,8 +1,9 @@ -var express = require('express'); -var router = express.Router(); -var path = require('path'); +const express = require('express'); +const router = express.Router(); +const path = require('path'); +const requireAuth = require('../util/auth').requireAuth; -router.get('/', function(req, res) { +router.get('/', requireAuth(), function(req, res) { res.sendFile(path.join(__dirname, '../../public/views', 'panel.html')); });