Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

some cleanup

Kiran Ka5ca35bd581d
diff --git a/apps/web/app/(ee)/api/hubspot/webhook/route.ts b/apps/web/app/(ee)/api/hubspot/webhook/route.ts
index 24b497c649..32cce2f85c 100644
--- a/apps/web/app/(ee)/api/hubspot/webhook/route.ts
+++ b/apps/web/app/(ee)/api/hubspot/webhook/route.ts
@@ -89,7 +89,7 @@ async function processWebhookEvent(event: any) {
return;
}
- const workspace = installation.project;
+ const { project: workspace } = installation;
// Refresh the access token if needed
const authToken =
diff --git a/apps/web/lib/integrations/hubspot/oauth.ts b/apps/web/lib/integrations/hubspot/oauth.ts
index 145b1c0572..06d729d1cd 100644
--- a/apps/web/lib/integrations/hubspot/oauth.ts
+++ b/apps/web/lib/integrations/hubspot/oauth.ts
@@ -5,7 +5,9 @@ import { OAuthProvider, OAuthProviderConfig } from "../oauth-provider";
import { hubSpotAuthTokenSchema } from "./schema";
import { HubSpotAuthToken } from "./types";
-class HubSpotOAuthProvider extends OAuthProvider<typeof hubSpotAuthTokenSchema> {
+class HubSpotOAuthProvider extends OAuthProvider<
+ typeof hubSpotAuthTokenSchema
+> {
constructor(config: OAuthProviderConfig) {
super(config);
}
@@ -19,7 +21,7 @@ class HubSpotOAuthProvider extends OAuthProvider<typeof hubSpotAuthTokenSchema>
return token;
}
- const newToken = await this.refreshToken(token.access_token);
+ const newToken = await this.refreshToken(token.refresh_token);
const credentials = {
...newToken,
diff --git a/apps/web/lib/integrations/oauth-provider.ts b/apps/web/lib/integrations/oauth-provider.ts
index ee44c1812f..03dcaf0254 100644
--- a/apps/web/lib/integrations/oauth-provider.ts
+++ b/apps/web/lib/integrations/oauth-provider.ts
@@ -117,8 +117,3 @@ export class OAuthProvider<T extends z.ZodSchema> {
return this.provider.tokenSchema.parse(result);
}
}
-
-// TODO:
-// HubSpot
-// Slack
-// PayPal