Skip to content

Scheduling infrastructure for absolutely everyone.

Save refresh token (#7661)

Joe Au-Yeung7b21839c737e
diff --git a/packages/app-store/office365calendar/lib/CalendarService.ts b/packages/app-store/office365calendar/lib/CalendarService.ts
index 0d5755c434f..6d22d430b3e 100644
--- a/packages/app-store/office365calendar/lib/CalendarService.ts
+++ b/packages/app-store/office365calendar/lib/CalendarService.ts
@@ -217,8 +217,13 @@ export default class Office365CalendarService implements Calendar {
client_secret,
}),
});
- const responseBody = await handleErrorsJson<{ access_token: string; expires_in: number }>(response);
+ const responseBody = await handleErrorsJson<{
+ access_token: string;
+ expires_in: number;
+ refresh_token: string;
+ }>(response);
o365AuthCredentials.access_token = responseBody.access_token;
+ o365AuthCredentials.refresh_token = responseBody.refresh_token;
o365AuthCredentials.expiry_date = Math.round(+new Date() / 1000 + responseBody.expires_in);
await prisma.credential.update({
where: {