Files
calendar/packages/app-store/_utils/oauth/decodeOAuthState.ts
f1b4d7d9e0 feat: app install flow followup (#15193)
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Omar López <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
2024-07-08 19:15:57 +02:00

13 lines
334 B
TypeScript

import type { NextApiRequest } from "next";
import type { IntegrationOAuthCallbackState } from "../../types";
export function decodeOAuthState(req: NextApiRequest) {
if (typeof req.query.state !== "string") {
return undefined;
}
const state: IntegrationOAuthCallbackState = JSON.parse(req.query.state);
return state;
}