Fixes zoom expiry date (#1315)

* Fixes zoom expiry date

* Ensure backwards compatibility with old zoom connections

Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
Alex van AndelandBailey Pumfleet authored and GitHub committed 2021-12-15 14:02:39 +00:00
1 parent c2a60657d4
commit 5c5d9d3406
2 files changed
+14 -6

No files matched your search

+6 -2
View File
@@ -30,7 +30,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
},
}
);
const json = await result.json();
const responseBody = await result.json();
responseBody.expiry_date = Math.round(Date.now() + responseBody.expires_in * 1000);
delete responseBody.expires_in;
await prisma.user.update({
where: {
@@ -40,7 +44,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
credentials: {
create: {
type: "zoom_video",
key: json,
key: responseBody,
},
},
},