Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

look by subId as a backup

Blue Mouse2a25452f5ae7
diff --git a/backend/apps/cloud/src/webhook/webhook.controller.ts b/backend/apps/cloud/src/webhook/webhook.controller.ts
index 7799e9d64..d21549094 100644
--- a/backend/apps/cloud/src/webhook/webhook.controller.ts
+++ b/backend/apps/cloud/src/webhook/webhook.controller.ts
@@ -127,16 +127,20 @@ export class WebhookController {
)
}
- const currentUser = uid
+ let currentUser = uid
? await this.userService.findOne({ where: { id: uid } })
: await this.userService.findOne({ where: { email } })
if (!currentUser) {
- this.logger.error(
- '[PADDLE WEBHOOK / FATAL] Cannot find the webhook user',
- )
- this.logger.error(JSON.stringify(body, null, 2))
- return
+ currentUser = await this.userService.findOne({ where: { subID } })
+
+ if (!currentUser) {
+ this.logger.error(
+ '[PADDLE WEBHOOK / FATAL] Cannot find the webhook user',
+ )
+ this.logger.error(JSON.stringify(body, null, 2))
+ return
+ }
}
const shouldUnlock =