mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
fix(delete account): allow deleting account after they've canceled
subscription, before it terminates
This commit is contained in:
parent
e8779f2121
commit
973732421a
1 changed files with 2 additions and 1 deletions
|
|
@ -258,7 +258,8 @@ api.cron = function(req, res, next) {
|
||||||
// api.reset // Shared.ops
|
// api.reset // Shared.ops
|
||||||
|
|
||||||
api['delete'] = function(req, res, next) {
|
api['delete'] = function(req, res, next) {
|
||||||
if (res.locals.user.purchased.plan.customerId)
|
var plan = res.locals.user.purchased.plan;
|
||||||
|
if (plan && plan.customerId && !plan.dateTerminated)
|
||||||
return res.json(400,{err:"You have an active subscription, cancel your plan before deleting your account."});
|
return res.json(400,{err:"You have an active subscription, cancel your plan before deleting your account."});
|
||||||
res.locals.user.remove(function(err){
|
res.locals.user.remove(function(err){
|
||||||
if (err) return next(err);
|
if (err) return next(err);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue