From a46c89e45ee9dee121b589f665330d9ce71483d2 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Mon, 13 Apr 2026 14:43:39 +0300 Subject: [PATCH] feat: send campaign_slug during standalone email registration Frontend now reads campaign slug from localStorage and includes it in the registration API call, ensuring campaign attribution works even if email verification happens in a different browser. --- src/api/auth.ts | 1 + src/store/auth.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/api/auth.ts b/src/api/auth.ts index 4eae2be..7bfd3fa 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -97,6 +97,7 @@ export const authApi = { first_name?: string; language?: string; referral_code?: string; + campaign_slug?: string; }): Promise => { const response = await apiClient.post( '/cabinet/auth/email/register/standalone', diff --git a/src/store/auth.ts b/src/store/auth.ts index abea27d..2f56553 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -359,12 +359,14 @@ export const useAuthStore = create()( registerWithEmail: async (email, password, firstName, referralCode) => { const code = referralCode || getPendingReferralCode() || undefined; + const campaignSlug = getPendingCampaignSlug() || undefined; const response = await authApi.registerEmailStandalone({ email, password, first_name: firstName, language: navigator.language.split('-')[0] || 'ru', referral_code: code, + campaign_slug: campaignSlug, }); consumeReferralCode(); return response;