aboutsummaryrefslogtreecommitdiff
path: root/controllers/post.js
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-05-07 01:16:03 +0200
committerMateja <mail@matejamaric.com>2021-05-07 01:16:03 +0200
commitb99ff3787373aec8b0d679f301609361d39362e4 (patch)
treedc1846939632dc53c4836f8a609182bc2dff5a23 /controllers/post.js
parent5f58ad7e7b7546077556abd70fca44b296bb0c0c (diff)
downloadnode-playground-b99ff3787373aec8b0d679f301609361d39362e4.tar.gz
node-playground-b99ff3787373aec8b0d679f301609361d39362e4.zip
Change page layout if user is logged in.
Diffstat (limited to 'controllers/post.js')
-rw-r--r--controllers/post.js2
1 files changed, 2 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
});
},