Fix auth connection (#15869)

Better to do auth this way than in module
This commit is contained in:
Félix Malfait
2025-11-17 18:12:48 +01:00
committed by GitHub
parent 8d7ee47ec5
commit 19ca93b954
9 changed files with 58 additions and 39 deletions
@@ -2,7 +2,7 @@
import { Injectable, Logger } from '@nestjs/common';
import { type GaxiosError } from 'gaxios';
import { type calendar_v3 as calendarV3 } from 'googleapis';
import { google, type calendar_v3 as calendarV3 } from 'googleapis';
import { formatGoogleCalendarEvents } from 'src/modules/calendar/calendar-event-import-manager/drivers/google-calendar/utils/format-google-calendar-event.util';
import { parseGaxiosError } from 'src/modules/calendar/calendar-event-import-manager/drivers/google-calendar/utils/parse-gaxios-error.util';
@@ -31,7 +31,10 @@ export class GoogleCalendarGetEventsService {
connectedAccount,
);
const googleCalendarClient = oAuth2Client.calendar({ version: 'v3' });
const googleCalendarClient = google.calendar({
version: 'v3',
auth: oAuth2Client,
});
let nextSyncToken: string | null | undefined;
let nextPageToken: string | undefined;