Merge pull request #10432 from BerkeleyTrue/fix/add-delete-page
Fix(settings): Add separate delete page
This commit is contained in:
@@ -168,6 +168,11 @@ module.exports = function(app) {
|
||||
router.get('/email-signin', getEmailSignin);
|
||||
router.get('/deprecated-signin', getDepSignin);
|
||||
router.get('/update-email', getUpdateEmail);
|
||||
router.get(
|
||||
'/delete-my-account',
|
||||
sendNonUserToMap,
|
||||
showDelete
|
||||
);
|
||||
api.post(
|
||||
'/account/delete',
|
||||
ifNoUser401,
|
||||
@@ -432,6 +437,10 @@ module.exports = function(app) {
|
||||
);
|
||||
}
|
||||
|
||||
function showDelete(req, res) {
|
||||
return res.render('account/delete', { title: 'Delete My Account!' });
|
||||
}
|
||||
|
||||
function postDeleteAccount(req, res, next) {
|
||||
User.destroyById(req.user.id, function(err) {
|
||||
if (err) { return next(err); }
|
||||
|
||||
Reference in New Issue
Block a user