diff --git a/src/store/auth.ts b/src/store/auth.ts index ccee53d..3f6979c 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -33,7 +33,7 @@ interface AuthState { loginWithTelegram: (initData: string) => Promise loginWithTelegramWidget: (data: TelegramWidgetData) => Promise loginWithEmail: (email: string, password: string) => Promise - registerWithEmail: (email: string, password: string, firstName?: string) => Promise + registerWithEmail: (email: string, password: string, firstName?: string, referralCode?: string) => Promise } // Блокировка для предотвращения race condition при инициализации @@ -262,12 +262,13 @@ export const useAuthStore = create()( get().checkAdminStatus() }, - registerWithEmail: async (email, password, firstName) => { + registerWithEmail: async (email, password, firstName, referralCode) => { const response = await authApi.registerEmailStandalone({ email, password, first_name: firstName, language: navigator.language.split('-')[0] || 'ru', + referral_code: referralCode, }) tokenStorage.setTokens(response.access_token, response.refresh_token) set({