Check the truth of subscription.customAccount, rather than definition.

This commit is contained in:
Shane Kilkelly 2016-07-19 10:28:43 +01:00
parent effc3727be
commit 3aea3a68d1

View file

@ -38,7 +38,7 @@ module.exports =
SubscriptionLocator.getUsersSubscription user._id, (err, subscription)->
if err?
return callback(err)
hasValidSubscription = subscription? and (subscription.recurlySubscription_id? or subscription.customAccount?)
hasValidSubscription = subscription? and (subscription.recurlySubscription_id? or subscription?.customAccount == true)
logger.log user:user, hasValidSubscription:hasValidSubscription, subscription:subscription, "checking if user has subscription"
callback err, hasValidSubscription, subscription