completionId: cgen-fdc1a19948304a6f80bbab5ea09e34e1
cgen-fdc1a19948304a6f80bbab5ea09e34e1
This commit is contained in:
parent
bdf45b1874
commit
1d84caf98b
1 changed files with 11 additions and 1 deletions
|
|
@ -316,8 +316,18 @@ export default function Onboarding() {
|
||||||
user.email?.split("@")[0] ||
|
user.email?.split("@")[0] ||
|
||||||
"user";
|
"user";
|
||||||
const normalizedLast = data.personalInfo.lastName?.trim() || "";
|
const normalizedLast = data.personalInfo.lastName?.trim() || "";
|
||||||
|
|
||||||
|
// Use username from form if provided, otherwise generate from first name
|
||||||
|
const usernameFromForm = data.username?.trim().toLowerCase();
|
||||||
|
const generatedUsername = normalizedFirst.replace(/\s+/g, "_").toLowerCase();
|
||||||
|
const finalUsername = usernameFromForm || generatedUsername;
|
||||||
|
|
||||||
|
if (!finalUsername) {
|
||||||
|
throw new Error("Username is required to complete profile setup");
|
||||||
|
}
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
username: normalizedFirst.replace(/\s+/g, "_"),
|
username: finalUsername,
|
||||||
full_name: `${normalizedFirst} ${normalizedLast}`.trim(),
|
full_name: `${normalizedFirst} ${normalizedLast}`.trim(),
|
||||||
user_type:
|
user_type:
|
||||||
(userTypeMap[data.userType || "member"] as any) || "game_developer",
|
(userTypeMap[data.userType || "member"] as any) || "game_developer",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue