From 7b21839c737ef6385fe87f8cf4d35cec15ba341b Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:42:20 -0500 Subject: [PATCH] Save refresh token (#7661) --- .../app-store/office365calendar/lib/CalendarService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app-store/office365calendar/lib/CalendarService.ts b/packages/app-store/office365calendar/lib/CalendarService.ts index 0d5755c434..6d22d430b3 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: {