Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

fix: youtube and gmb

Nevo David691d15db0331
diff --git a/libraries/nestjs-libraries/src/integrations/social/gmb.provider.ts b/libraries/nestjs-libraries/src/integrations/social/gmb.provider.ts
index c3e153147..3fa7de95a 100644
--- a/libraries/nestjs-libraries/src/integrations/social/gmb.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/gmb.provider.ts
@@ -64,6 +64,14 @@ export class GmbProvider extends SocialAbstract implements SocialProvider {
};
}
+ if (body.includes('Unauthorized')) {
+ return {
+ type: 'refresh-token',
+ value:
+ 'Token expired or invalid, please reconnect your YouTube account.',
+ };
+ }
+
if (body.includes('PERMISSION_DENIED')) {
return {
type: 'refresh-token',
diff --git a/libraries/nestjs-libraries/src/integrations/social/youtube.provider.ts b/libraries/nestjs-libraries/src/integrations/social/youtube.provider.ts
index 96b8858e0..3b17e8e6d 100644
--- a/libraries/nestjs-libraries/src/integrations/social/youtube.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/youtube.provider.ts
@@ -125,6 +125,13 @@ export class YoutubeProvider extends SocialAbstract implements SocialProvider {
};
}
+ if (body.includes('UNAUTHENTICATED') || body.includes('invalid_grant')) {
+ return {
+ type: 'refresh-token',
+ value: 'Please re-authenticate your YouTube account',
+ };
+ }
+
return undefined;
}
@@ -228,10 +235,7 @@ export class YoutubeProvider extends SocialAbstract implements SocialProvider {
}
}
- async fetchPageInformation(
- accessToken: string,
- data: { id: string }
- ) {
+ async fetchPageInformation(accessToken: string, data: { id: string }) {
const { client, youtube } = clientAndYoutube();
client.setCredentials({ access_token: accessToken });
const youtubeClient = youtube(client);