mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Wire SMS registration, forgot password, and one-time login.
Connect business and customer login pages to login-otp and reset-password, and document the auth flows in project context. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
d8c9c0b017
commit
c33cab40fe
@@ -54,6 +54,23 @@ export async function verifyOtp(cellNumber: string, code: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function loginWithOtp(cellNumber: string, code: string) {
|
||||
const data = await apiRequest<LoginResponse>('/auth/login-otp', {
|
||||
method: 'POST',
|
||||
body: { cellNumber, code },
|
||||
})
|
||||
|
||||
setTokens(data.accessToken, data.refreshToken)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function resetPassword(cellNumber: string, code: string, newPassword: string) {
|
||||
return apiRequest<{ message: string }>('/auth/reset-password', {
|
||||
method: 'POST',
|
||||
body: { cellNumber, code, newPassword },
|
||||
})
|
||||
}
|
||||
|
||||
export async function changePassword(currentPassword: string, newPassword: string) {
|
||||
return apiRequest<{ message: string }>('/auth/change-password', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user