feat: store ads clickid when creating an account (#25763)
* feat: store ads clickid when creating an account * fix: type check * fix: google campaignId not being added to stripe * remove tracking in stripe app
This commit is contained in:
1 parent
b664857809
commit
f5b9b6b0f9
7 files changed
+79
-19
No files matched your search
@@ -2,12 +2,14 @@ import type { GetServerSidePropsContext } from "next";
|
||||
|
||||
import { getServerSession } from "@calcom/feature-auth/lib/getServerSession";
|
||||
import { getOptions } from "@calcom/feature-auth/lib/next-auth-options";
|
||||
import { getTrackingFromCookies } from "@calcom/lib/tracking";
|
||||
|
||||
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
|
||||
const session = await getServerSession({
|
||||
req: context.req,
|
||||
authOptions: getOptions({
|
||||
getDubId: () => context.req.cookies.dub_id || context.req.cookies.dclid,
|
||||
getTrackingData: () => getTrackingFromCookies(context.req.cookies),
|
||||
}),
|
||||
});
|
||||
// Disable this check if we ever make this self serve.
|
||||
|
||||
@@ -2,9 +2,17 @@ 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 }));
|
||||
NextAuth(
|
||||
req,
|
||||
res,
|
||||
getOptions({
|
||||
getDubId: () => req.cookies.dub_id || req.cookies.dclid,
|
||||
getTrackingData: () => getTrackingFromCookies(req.cookies),
|
||||
})
|
||||
);
|
||||
|
||||
export default handler;
|
||||
Reference in new issue
Block a user