f9d40e083f
* feat: store utm params in stripe on signup * fix: fallback to cookie when query params don't contain valid UTM data Changed from else-if to separate if statement so that when query params exist but don't contain valid UTM data, the cookie fallback is still tried. Previously, any request with non-UTM query params would skip the stored cookie data entirely. Co-Authored-By: unknown <> * fix: e2e --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
19 lines
602 B
TypeScript
19 lines
602 B
TypeScript
import type { NextApiRequest, NextApiResponse } from "next";
|
|
import NextAuth from "next-auth";
|
|
|
|
import { getOptions } from "@calcom/features/auth/lib/next-auth-options";
|
|
import { getTrackingFromCookies } from "@calcom/lib/tracking";
|
|
|
|
// pass req to NextAuth: https://github.com/nextauthjs/next-auth/discussions/469
|
|
const handler = (req: NextApiRequest, res: NextApiResponse) =>
|
|
NextAuth(
|
|
req,
|
|
res,
|
|
getOptions({
|
|
getDubId: () => req.cookies.dub_id || req.cookies.dclid,
|
|
getTrackingData: () => getTrackingFromCookies(req.cookies, req.query),
|
|
})
|
|
);
|
|
|
|
export default handler;
|