* Enforces explicit type imports * Upgrades typescript-eslint * Upgrades eslint related dependencies * Update config * Sync packages mismatches * Syncs prettier version * Linting * Relocks node version * Fixes * Locks @vitejs/plugin-react to 1.3.2 * Linting
13 lines
331 B
TypeScript
13 lines
331 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;
|
|
}
|