2
0
Files

13 lines
334 B
TypeScript
Raw Permalink Normal View History

2024-08-09 00:39:27 +02:00
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;
}