feat: add gdpr privacy and terms

This commit is contained in:
Mrugesh Mohapatra
2018-05-27 17:29:04 +05:30
parent d68c568490
commit 3ad70a7926
6 changed files with 195 additions and 2 deletions

View File

@@ -51,6 +51,20 @@ module.exports = function enableAuthentication(app) {
})
);
router.get(
'/accept-privacy-terms',
ifNoUserRedirectHome,
(req, res) => {
const { user } = req;
if (user && !user.acceptedPrivacyTerms) {
return res.render('account/accept-privacy-terms', {
title: 'Privacy Policy and Terms of Service'
});
}
return res.redirect('/settings');
}
);
const defaultErrorMsg = dedent`
Oops, something is not right,
please request a fresh link to sign in / sign up.