diff --git a/public/templates/account.tpl b/public/templates/account.tpl new file mode 100644 index 0000000000..0a66dc2040 --- /dev/null +++ b/public/templates/account.tpl @@ -0,0 +1,18 @@ +

Account Settings

+
+ +
+ +

+ If you see this, you are logged in. +

+
+ \ No newline at end of file diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 2068576586..def57eaed5 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -30,7 +30,7 @@
  • Forum
  • diff --git a/src/templates.js b/src/templates.js index e56f09f39d..17b41592d7 100644 --- a/src/templates.js +++ b/src/templates.js @@ -25,7 +25,7 @@ Templates.init = function() { loadTemplates([ - 'header', 'footer', 'register', 'home', 'topic', + 'header', 'footer', 'register', 'home', 'topic', 'account', 'login', 'reset', 'reset_code', 'logout', '403', 'emails/reset', 'emails/reset_plaintext' diff --git a/src/webserver.js b/src/webserver.js index b9941dfd58..3b63f9d363 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -78,14 +78,6 @@ passport.deserializeUser(function(uid, done) { (function(app) { var templates = global.templates; - function refreshTemplates() { - //need a better solution than copying this code on every call. is there an "onconnect" event? - if (DEVELOPMENT === true) { - // refreshing templates - modules.templates.init(); - } - } - // Middlewares app.use(express.favicon()); // 2 args: string path and object options (i.e. expire time etc) app.use(require('less-middleware')({ src: path.join(__dirname, '../', '/public') })); @@ -259,8 +251,11 @@ passport.deserializeUser(function(uid, done) { }); app.get('/account', function(req, res) { - refreshTemplates(); - res.send(templates['header'] + templates['account_settings'] + templates['footer']); + + if (req.user === undefined) + return res.redirect('/403'); + + res.send(templates['header'] + templates['account'] + templates['footer']); }); app.get('/users', function(req, res) {