@nativesquare/soma 0.16.8 → 0.16.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/client/strava.ts +3 -2
package/package.json
CHANGED
package/src/client/strava.ts
CHANGED
|
@@ -305,15 +305,16 @@ export class SomaStrava {
|
|
|
305
305
|
updates?: Record<string, unknown>;
|
|
306
306
|
};
|
|
307
307
|
const rawEventName = `${p.object_type}-${p.aspect_type}`;
|
|
308
|
+
const authorizedFlag = p.updates?.authorized;
|
|
308
309
|
const isDeauthorize =
|
|
309
310
|
rawEventName === "athlete-update" &&
|
|
310
|
-
String(
|
|
311
|
+
(authorizedFlag === false || String(authorizedFlag) === "false");
|
|
311
312
|
const eventName = (isDeauthorize
|
|
312
313
|
? "athlete-deauthorize"
|
|
313
314
|
: rawEventName) as StravaWebhookEventName;
|
|
314
315
|
|
|
315
316
|
console.log(
|
|
316
|
-
`[soma:strava:webhook] received eventName=${eventName} ownerId=${p.owner_id} objectId=${p.object_id}`,
|
|
317
|
+
`[soma:strava:webhook] received eventName=${eventName} ownerId=${p.owner_id} objectId=${p.object_id} rawPayload=${JSON.stringify(payload)}`,
|
|
317
318
|
);
|
|
318
319
|
|
|
319
320
|
if (!webhookCfg.events?.[eventName]) {
|