fix: youtube and gmb

This commit is contained in:
Nevo David 2026-01-05 18:54:11 +07:00
parent dac6e8e189
commit 691d15db03
2 changed files with 16 additions and 4 deletions

View File

@ -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',

View File

@ -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);