From a73d9ce39e2107b2a9628003f05900d4a641bee5 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Fri, 2 Dec 2016 01:58:14 +0800 Subject: Update to support optional email register and signin --- lib/response.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/response.js') diff --git a/lib/response.js b/lib/response.js index 0004f824..aae39851 100755 --- a/lib/response.js +++ b/lib/response.js @@ -66,7 +66,10 @@ function showIndex(req, res, next) { gitlab: config.gitlab, dropbox: config.dropbox, google: config.google, - signin: req.isAuthenticated() + email: config.email, + signin: req.isAuthenticated(), + infoMessage: req.flash('info'), + errorMessage: req.flash('error') }); } @@ -94,7 +97,8 @@ function responseHackMD(res, note) { github: config.github, gitlab: config.gitlab, dropbox: config.dropbox, - google: config.google + google: config.google, + email: config.email }); } @@ -202,9 +206,9 @@ function showPublishNote(req, res, next) { body: body, useCDN: config.usecdn, owner: note.owner ? note.owner.id : null, - ownerprofile: note.owner ? models.User.parseProfile(note.owner.profile) : null, + ownerprofile: note.owner ? models.User.getProfile(note.owner) : null, lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null, - lastchangeuserprofile: note.lastchangeuser ? models.User.parseProfile(note.lastchangeuser.profile) : null, + lastchangeuserprofile: note.lastchangeuser ? models.User.getProfile(note.lastchangeuser) : null, robots: meta.robots || false, //default allow robots GA: meta.GA, disqus: meta.disqus @@ -591,9 +595,9 @@ function showPublishSlide(req, res, next) { meta: JSON.stringify(obj.meta || {}), useCDN: config.usecdn, owner: note.owner ? note.owner.id : null, - ownerprofile: note.owner ? models.User.parseProfile(note.owner.profile) : null, + ownerprofile: note.owner ? models.User.getProfile(note.owner) : null, lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null, - lastchangeuserprofile: note.lastchangeuser ? models.User.parseProfile(note.lastchangeuser.profile) : null, + lastchangeuserprofile: note.lastchangeuser ? models.User.getProfile(note.lastchangeuser) : null, robots: meta.robots || false, //default allow robots GA: meta.GA, disqus: meta.disqus -- cgit v1.2.3