mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Merge pull request #830 from SISheogorath/feature/GDPR
GDPR compliant part 1
This commit is contained in:
commit
56d78a7d6c
13 changed files with 216 additions and 30 deletions
|
@ -2,6 +2,7 @@
|
|||
// response
|
||||
// external modules
|
||||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var markdownpdf = require('markdown-pdf')
|
||||
var shortId = require('shortid')
|
||||
var querystring = require('querystring')
|
||||
|
@ -61,7 +62,10 @@ function responseError (res, code, detail, msg) {
|
|||
}
|
||||
|
||||
function showIndex (req, res, next) {
|
||||
res.render(config.indexPath, {
|
||||
var authStatus = req.isAuthenticated()
|
||||
var deleteToken = ''
|
||||
|
||||
var data = {
|
||||
url: config.serverURL,
|
||||
useCDN: config.useCDN,
|
||||
allowAnonymous: config.allowAnonymous,
|
||||
|
@ -81,10 +85,28 @@ function showIndex (req, res, next) {
|
|||
email: config.isEmailEnable,
|
||||
allowEmailRegister: config.allowEmailRegister,
|
||||
allowPDFExport: config.allowPDFExport,
|
||||
signin: req.isAuthenticated(),
|
||||
signin: authStatus,
|
||||
infoMessage: req.flash('info'),
|
||||
errorMessage: req.flash('error')
|
||||
})
|
||||
errorMessage: req.flash('error'),
|
||||
privacyStatement: fs.existsSync(path.join(config.docsPath, 'privacy.md')),
|
||||
termsOfUse: fs.existsSync(path.join(config.docsPath, 'terms-of-use.md')),
|
||||
deleteToken: deleteToken
|
||||
}
|
||||
|
||||
if (authStatus) {
|
||||
models.User.findOne({
|
||||
where: {
|
||||
id: req.user.id
|
||||
}
|
||||
}).then(function (user) {
|
||||
if (user) {
|
||||
data.deleteToken = user.deleteToken
|
||||
res.render(config.indexPath, data)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
res.render(config.indexPath, data)
|
||||
}
|
||||
}
|
||||
|
||||
function responseHackMD (res, note) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue