improve(amazon-payments): do not redirect after cancellation with ?noRedirect=true

This commit is contained in:
Matteo Pagliazzi
2015-07-03 14:56:19 +02:00
parent f6480faf22
commit 313ac91020
+7 -1
View File
@@ -238,7 +238,13 @@ exports.subscribeCancel = function(req, res, next){
}
}, function(err, results){
if (err) return next(err); // don't json this, let toString() handle errors
res.redirect('/');
if(req.query.noRedirect){
res.send(200);
}else{
res.redirect('/');
}
user = null;
});
};