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
This commit is contained in:
@@ -155,7 +155,7 @@ export function SignUpForm({
|
|||||||
password: data.password,
|
password: data.password,
|
||||||
email: data.email || undefined,
|
email: data.email || undefined,
|
||||||
verification_code: verificationCode || undefined,
|
verification_code: verificationCode || undefined,
|
||||||
aff: getAffiliateCode(),
|
aff_code: getAffiliateCode(),
|
||||||
turnstile: turnstileToken,
|
turnstile: turnstileToken,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ export interface RegisterPayload {
|
|||||||
password: string
|
password: string
|
||||||
email?: string
|
email?: string
|
||||||
verification_code?: string
|
verification_code?: string
|
||||||
aff?: string
|
aff_code?: string
|
||||||
turnstile?: string
|
turnstile?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user