* Revert "Revert "feat: Sync app credentials between Cal.com & self-hosted plat… (#11450)"
This reverts commit 2565d0915a.
* Add typing to `parseRefreshTokenResponse`
* Add typing
* Return safeParse data
* Type fix and refactor in Zoom
13 lines
350 B
TypeScript
13 lines
350 B
TypeScript
import type { NextApiRequest } from "next";
|
|
|
|
import type { IntegrationOAuthCallbackState } from "../../types";
|
|
|
|
export function encodeOAuthState(req: NextApiRequest) {
|
|
if (typeof req.query.state !== "string") {
|
|
return undefined;
|
|
}
|
|
const state: IntegrationOAuthCallbackState = JSON.parse(req.query.state);
|
|
|
|
return JSON.stringify(state);
|
|
}
|