aboutsummaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'controllers')
-rw-r--r--controllers/post.js2
-rw-r--r--controllers/user.js2
2 files changed, 4 insertions, 0 deletions
diff --git a/controllers/post.js b/controllers/post.js
index d879fcc..09bbdec 100644
--- a/controllers/post.js
+++ b/controllers/post.js
@@ -6,6 +6,7 @@ module.exports = {
Post.find().lean().exec((err, posts) => {
res.render('home', {
title: 'Home Page',
+ auth: req.isAuthenticated(),
home: true,
posts: posts
});
@@ -15,6 +16,7 @@ module.exports = {
create(req, res) {
res.render('new-post', {
title: 'Make A New Post',
+ auth: req.isAuthenticated(),
newPost: true
});
},
diff --git a/controllers/user.js b/controllers/user.js
index 31afdfc..c64bfa0 100644
--- a/controllers/user.js
+++ b/controllers/user.js
@@ -29,6 +29,7 @@ module.exports = {
registerView(req, res) {
res.render('register', {
title: 'Register',
+ auth: req.isAuthenticated(),
register: true,
msg: req.flash('msg')
});
@@ -37,6 +38,7 @@ module.exports = {
loginView(req, res) {
res.render('login', {
title: 'Login',
+ auth: req.isAuthenticated(),
login: true,
msg: req.flash('msg')
});