summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-12-02 01:58:14 +0800
committerWu Cheng-Han2016-12-02 01:58:14 +0800
commita73d9ce39e2107b2a9628003f05900d4a641bee5 (patch)
tree15778b1a6e3322bfe6e6c7a68f2c6e31f4c34844 /lib/response.js
parent52772829ce8ccc7eac1fe1df9ace65d90ef36a2c (diff)
Update to support optional email register and signin
Diffstat (limited to 'lib/response.js')
-rwxr-xr-xlib/response.js16
1 files changed, 10 insertions, 6 deletions
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