Add OTP-first customer signup and product catalog PDF field.

Registration collects name and phone, verifies SMS, then asks for a password only for new Meshkee accounts. Product add/edit supports an optional catalog PDF.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-09-27 08:57:08 +03:30
co-authored by Cursor
parent e2950fa20e
commit 6d85a217e1
12 changed files with 746 additions and 292 deletions
+36
View File
@@ -7,6 +7,8 @@ import type {
OtpSendResponse,
OtpVerifyResponse,
RegisterResponse,
SignupStartResponse,
SignupVerifyResponse,
HandoffCreateResponse,
UserProfile,
} from '../types/auth'
@@ -45,6 +47,40 @@ export async function register(input: {
return data
}
export async function startSignup(input: {
cellNumber: string
firstName: string
lastName: string
domain: string
}) {
return apiRequest<SignupStartResponse>('/auth/signup/start', {
method: 'POST',
body: input,
})
}
export async function verifySignupOtp(cellNumber: string, code: string) {
return apiRequest<SignupVerifyResponse>('/auth/signup/verify-otp', {
method: 'POST',
body: { cellNumber, code },
})
}
export async function completeSignup(input: {
registrationToken: string
password?: string
}) {
const data = await apiRequest<RegisterResponse>('/auth/signup/complete', {
method: 'POST',
body: input,
})
if (data.accessToken && data.refreshToken) {
setTokens(data.accessToken, data.refreshToken)
}
return data
}
export async function fetchCurrentUser(signal?: AbortSignal) {
return apiRequest<MeResponse>('/auth/me', { auth: true, signal })
}