From 0cd9a3a0681889d9ab6a7d919e47cddb8f2174e3 Mon Sep 17 00:00:00 2001 From: Calcium-Ion Date: Tue, 19 May 2026 16:39:42 +0800 Subject: [PATCH] fix(auth): use aff_code field name in registration payload (#4945) (#4965) The new UI's sign-up form sent the invite code under key `aff`, but the backend `Register` controller binds it to `User.AffCode` whose JSON tag is `aff_code` (see model/user.go). Result: every invited sign-up landed with `inviter_id = 0`, breaking the affiliate flow. Rename only the request payload field so it matches the backend contract. URL query parameter (`/sign-up?aff=...`), localStorage key and OAuth state continue to use `aff` and are unchanged. Closes #4945 --- .../src/features/auth/sign-up/components/sign-up-form.tsx | 2 +- web/default/src/features/auth/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/default/src/features/auth/sign-up/components/sign-up-form.tsx b/web/default/src/features/auth/sign-up/components/sign-up-form.tsx index b3a5813d..b5ebd0b8 100644 --- a/web/default/src/features/auth/sign-up/components/sign-up-form.tsx +++ b/web/default/src/features/auth/sign-up/components/sign-up-form.tsx @@ -155,7 +155,7 @@ export function SignUpForm({ password: data.password, email: data.email || undefined, verification_code: verificationCode || undefined, - aff: getAffiliateCode(), + aff_code: getAffiliateCode(), turnstile: turnstileToken, }) diff --git a/web/default/src/features/auth/types.ts b/web/default/src/features/auth/types.ts index b429e20c..60aedd97 100644 --- a/web/default/src/features/auth/types.ts +++ b/web/default/src/features/auth/types.ts @@ -37,7 +37,7 @@ export interface RegisterPayload { password: string email?: string verification_code?: string - aff?: string + aff_code?: string turnstile?: string }