Skip to content

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

fix(x): mark the channel for reconnect on Unauthorized media upload errors

Gilad Resisi935c80a8e1aa
diff --git a/libraries/nestjs-libraries/src/integrations/social/x.provider.ts b/libraries/nestjs-libraries/src/integrations/social/x.provider.ts
index 51512fbdf..834a83267 100644
--- a/libraries/nestjs-libraries/src/integrations/social/x.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/x.provider.ts
@@ -232,6 +232,12 @@ export class XProvider extends SocialAbstract implements SocialProvider {
'The video you are trying to post is longer than 2 minutes, which is not allowed for this account',
};
}
+ if (body.includes('"title":"Unauthorized"')) {
+ return {
+ type: 'refresh-token',
+ value: 'X rejected the connected account, please reconnect your account',
+ };
+ }
return undefined;
}