Skip to content

Commit

Permalink
Change bearer token check
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelbsky committed Dec 12, 2024
1 parent 9f00bf6 commit 8a4fc95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/bsync/src/purchases/revenueCatClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ export class RevenueCatClient {
}

isWebhookAuthorizationValid(authorization: string | undefined): boolean {
return authorization === this.webhookAuthorization
return authorization === `Bearer ${this.webhookAuthorization}`
}
}
4 changes: 2 additions & 2 deletions packages/bsync/tests/purchases.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
RcGetSubscriberResponse,
} from '../src/purchases'

const revenueCatWebhookAuthorization = 'Bearer any-token'
const revenueCatWebhookAuthorization = 'any-token'

describe('purchases', () => {
let bsync: BsyncService
Expand Down Expand Up @@ -760,7 +760,7 @@ const callWebhook = async (
method: 'POST',
body: JSON.stringify(body),
headers: {
Authorization: revenueCatWebhookAuthorization,
Authorization: `Bearer ${revenueCatWebhookAuthorization}`,
'Content-Type': 'application/json',
},
})
Expand Down

0 comments on commit 8a4fc95

Please sign in to comment.