Skip to content

Commit

Permalink
Fix issue with only one access token per inapp purchase
Browse files Browse the repository at this point in the history
Check looking at existing user's access token didn't include
device token condition. In case device 2 wanted to claim
the purchase (via restore purchase), access token of device 1
was overwritten and device 1 lost the access to inapp purchase.
  • Loading branch information
rootpd committed Sep 29, 2020
1 parent bb62ec0 commit cb4ffa3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/api/VerifyPurchaseApiHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ private function pairUserWithAuthorizedToken(UserTokenAuthorization $authorizati
if ($deviceToken) {
$accessToken = $this->accessTokensRepository
->allUserTokensBySource($user->id, GooglePlayBillingModule::USER_SOURCE_APP)
->where('device_token_id = ?', $deviceToken->id)
->limit(1)
->fetch();
if (!$accessToken) {
Expand Down

0 comments on commit cb4ffa3

Please sign in to comment.