update signup page
Build & Push / Pipeline Tests (push) Successful in 1m31s
Test / Type Check (all packages) (push) Successful in 52s
Build & Push / Build & Push Docker Image (push) Successful in 4m3s
Test / API Unit Tests (push) Successful in 1m2s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Carplace Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m2s

This commit is contained in:
root
2026-07-20 23:21:24 -04:00
parent 93fba7a318
commit 7ecd85e9b7
4 changed files with 127 additions and 10 deletions
@@ -5,6 +5,9 @@ import { z } from 'zod'
* See progressive-signup-plan.md Section 3.
*/
export const accountStartSchema = z.object({
firstName: z.string().trim().min(1).max(80),
lastName: z.string().trim().min(1).max(80),
companyName: z.string().trim().min(2).max(120),
email: z.string().email(),
password: z.string().min(8).max(128),
preferredLanguage: z.enum(['en', 'fr', 'ar']).default('en'),
@@ -42,7 +42,7 @@ export async function startAccount(body: AccountStartInput) {
const company = await tx.company.create({
data: {
name: '',
name: body.companyName,
slug,
email: body.email,
address: {},
@@ -53,7 +53,7 @@ export async function startAccount(body: AccountStartInput) {
await tx.brandSettings.create({
data: {
companyId: company.id,
displayName: body.email.split('@')[0] || 'My Workspace',
displayName: body.companyName,
subdomain: slug,
defaultLocale: body.preferredLanguage,
defaultCurrency: 'MAD',
@@ -78,8 +78,8 @@ export async function startAccount(body: AccountStartInput) {
data: {
companyId: company.id,
clerkUserId: `local_owner_${company.id}`,
firstName: '',
lastName: '',
firstName: body.firstName,
lastName: body.lastName,
email: body.email,
passwordHash,
emailVerificationToken: hashPublicAccessToken(verificationToken),