From 4d8784d537277a1988fe6d39b7d4ec37fe0bb63b Mon Sep 17 00:00:00 2001 From: rafael Date: Thu, 12 Dec 2024 18:57:20 -0300 Subject: [PATCH] Change bearer token check --- packages/bsync/src/purchases/revenueCatClient.ts | 2 +- packages/bsync/tests/purchases.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bsync/src/purchases/revenueCatClient.ts b/packages/bsync/src/purchases/revenueCatClient.ts index 70c89acd38e..a15891eb601 100644 --- a/packages/bsync/src/purchases/revenueCatClient.ts +++ b/packages/bsync/src/purchases/revenueCatClient.ts @@ -98,6 +98,6 @@ export class RevenueCatClient { } isWebhookAuthorizationValid(authorization: string | undefined): boolean { - return authorization === this.webhookAuthorization + return authorization === `Bearer ${this.webhookAuthorization}` } } diff --git a/packages/bsync/tests/purchases.test.ts b/packages/bsync/tests/purchases.test.ts index 7716ec07d83..50e390c112a 100644 --- a/packages/bsync/tests/purchases.test.ts +++ b/packages/bsync/tests/purchases.test.ts @@ -25,7 +25,7 @@ import { RcGetSubscriberResponse, } from '../src/purchases' -const revenueCatWebhookAuthorization = 'Bearer any-token' +const revenueCatWebhookAuthorization = 'any-token' describe('purchases', () => { let bsync: BsyncService @@ -760,7 +760,7 @@ const callWebhook = async ( method: 'POST', body: JSON.stringify(body), headers: { - Authorization: revenueCatWebhookAuthorization, + Authorization: `Bearer ${revenueCatWebhookAuthorization}`, 'Content-Type': 'application/json', }, })