first commit
This commit is contained in:
12
calcom/packages/app-store/_utils/oauth/encodeOAuthState.ts
Normal file
12
calcom/packages/app-store/_utils/oauth/encodeOAuthState.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user