knowmetools / km-api

The API behind our Know Me app
Apache License 2.0
4 stars 0 forks source link

Expired Apple receipts are being marked as active #481

Closed cdriehuys closed 5 years ago

cdriehuys commented 5 years ago

Environment (production/development) Occurs in: production

Describe the bug Uploading an expired Apple receipt marks the user's subscription as active.

To Reproduce Steps to reproduce the behavior:

  1. Create an Apple subscription for Know Me premium that is valid in all ways except for the fact that it is expired.
  2. Upload it to /know-me/subscription/apple/
  3. The overview from /know-me/subscription/ reports that the user's subscription is active even though the Apple receipt itself correctly displays an expiration time that is in the past.

Expected behavior The upload should be accepted but the user's subscription should be inactive.

Additional context When we fixed #475 with #476 we implemented a solution that activates a subscription if the Apple receipt passes validation. This is a false assumption because expired Apple subscriptions are still valid. To fix this we simply have to add an additional expiration check.