feat(premium): disallow deleting accounts until they've cancelled

payment plans
This commit is contained in:
Tyler Renelle
2014-04-14 23:07:30 -06:00
parent ffa21ca1f7
commit 56ab7384cf
2 changed files with 4 additions and 4 deletions
+2
View File
@@ -260,6 +260,8 @@ api.cron = function(req, res, next) {
// api.reset // Shared.ops
api['delete'] = function(req, res, next) {
if (res.locals.user.purchased.plan.customerId)
return res.json(400,{err:"You have an active subscription, cancel your plan before deleting your account."});
res.locals.user.remove(function(err){
if (err) return next(err);
res.send(200);