From 6d158e0c50d97dc56d05cfb5a27bcda223342d50 Mon Sep 17 00:00:00 2001 From: Alex Johansson Date: Thu, 19 Aug 2021 16:37:18 +0200 Subject: [PATCH] fix google auth callback (#500) * maybe fix? * fix * Update pages/api/integrations/googlecalendar/callback.ts Co-authored-by: Alex Johansson Co-authored-by: Alex van Andel --- pages/api/integrations/googlecalendar/callback.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/integrations/googlecalendar/callback.ts b/pages/api/integrations/googlecalendar/callback.ts index 26fd9b5b42..433735e728 100644 --- a/pages/api/integrations/googlecalendar/callback.ts +++ b/pages/api/integrations/googlecalendar/callback.ts @@ -23,11 +23,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const { client_secret, client_id, redirect_uris } = JSON.parse(credentials).web; const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, redirect_uris[0]); const token = await oAuth2Client.getToken(code); - + const key = token.res?.data; await prisma.credential.create({ data: { type: "google_calendar", - key: token as any, + key, userId: session.user.id, }, });