fix: youtube and gmb
This commit is contained in:
parent
dac6e8e189
commit
691d15db03
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue