fix(messaging): pin Google OAuth2 client to native fetch (#21668)
/closes TWENTY-SERVER-HFH <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21668?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
+5
-4
@@ -20,10 +20,11 @@ export class GoogleApisServiceAvailabilityService {
|
||||
async checkServicesAvailability(
|
||||
accessToken: string,
|
||||
): Promise<GoogleApisServiceAvailability> {
|
||||
const oAuth2Client = new google.auth.OAuth2(
|
||||
this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_ID'),
|
||||
this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_SECRET'),
|
||||
);
|
||||
const oAuth2Client = new google.auth.OAuth2({
|
||||
clientId: this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_ID'),
|
||||
clientSecret: this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_SECRET'),
|
||||
transporterOptions: { fetchImplementation: fetch },
|
||||
});
|
||||
|
||||
oAuth2Client.setCredentials({
|
||||
access_token: accessToken,
|
||||
|
||||
+5
-1
@@ -72,7 +72,11 @@ export class GoogleOAuth2ClientProvider {
|
||||
);
|
||||
|
||||
try {
|
||||
const oAuth2Client = new google.auth.OAuth2(clientId, clientSecret);
|
||||
const oAuth2Client = new google.auth.OAuth2({
|
||||
clientId,
|
||||
clientSecret,
|
||||
transporterOptions: { fetchImplementation: fetch },
|
||||
});
|
||||
|
||||
oAuth2Client.setCredentials({ refresh_token: plaintextRefreshToken });
|
||||
|
||||
|
||||
+5
-4
@@ -19,10 +19,11 @@ export class GoogleAPIRefreshAccessTokenService {
|
||||
async refreshTokens(
|
||||
refreshToken: PlaintextString,
|
||||
): Promise<ConnectedAccountPlaintextTokens> {
|
||||
const oAuth2Client = new google.auth.OAuth2(
|
||||
this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_ID'),
|
||||
this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_SECRET'),
|
||||
);
|
||||
const oAuth2Client = new google.auth.OAuth2({
|
||||
clientId: this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_ID'),
|
||||
clientSecret: this.twentyConfigService.get('AUTH_GOOGLE_CLIENT_SECRET'),
|
||||
transporterOptions: { fetchImplementation: fetch },
|
||||
});
|
||||
|
||||
oAuth2Client.setCredentials({
|
||||
refresh_token: refreshToken,
|
||||
|
||||
Reference in New Issue
Block a user