mirror of
https://github.com/hanzoai/calendar.git
synced 2026-09-24 22:42:24 +00:00
Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]>
13 lines
334 B
TypeScript
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;
|
|
}
|