From 50a96c9e9576122cd931fb8ffbf9c073aa5ecccc Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Tue, 14 Aug 2018 05:14:53 -0400 Subject: [PATCH] Add auth requirement on home and panel --- app/routes/home.js | 9 +++++---- app/routes/panel.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) 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')); });