fix check

This commit is contained in:
Phillip Thelen 2022-10-21 16:59:18 +02:00
parent c25b09c7ed
commit 31685c3e94

View file

@ -149,7 +149,7 @@ api.subscribe = async function subscribe (sku, user, receipt, headers, nextPayme
}
if (originalTransactionId) {
if (user && user.purchased.plan.customId !== originalTransactionId) {
if (user && user.isSubscribed() && user.purchased.plan.customId !== originalTransactionId) {
throw new NotAuthorized(this.constants.RESPONSE_ALREADY_USED);
}
const existingUser = await User.findOne({