mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
Update auth.ts
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import apiClient from './client'
|
import apiClient from './client'
|
||||||
import type { AuthResponse, TokenResponse, User } from '../types'
|
import type { AuthResponse, RegisterResponse, TokenResponse, User } from '../types'
|
||||||
|
|
||||||
export const authApi = {
|
export const authApi = {
|
||||||
// Telegram WebApp authentication
|
// Telegram WebApp authentication
|
||||||
@@ -43,20 +43,21 @@ export const authApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Register standalone email account (no Telegram required)
|
// Register standalone email account (no Telegram required)
|
||||||
|
// Returns message - user must verify email before login
|
||||||
registerEmailStandalone: async (data: {
|
registerEmailStandalone: async (data: {
|
||||||
email: string
|
email: string
|
||||||
password: string
|
password: string
|
||||||
first_name?: string
|
first_name?: string
|
||||||
language?: string
|
language?: string
|
||||||
referral_code?: string
|
referral_code?: string
|
||||||
}): Promise<AuthResponse> => {
|
}): Promise<RegisterResponse> => {
|
||||||
const response = await apiClient.post<AuthResponse>('/cabinet/auth/email/register/standalone', data)
|
const response = await apiClient.post<RegisterResponse>('/cabinet/auth/email/register/standalone', data)
|
||||||
return response.data
|
return response.data
|
||||||
},
|
},
|
||||||
|
|
||||||
// Verify email
|
// Verify email and get auth tokens
|
||||||
verifyEmail: async (token: string): Promise<{ message: string }> => {
|
verifyEmail: async (token: string): Promise<AuthResponse> => {
|
||||||
const response = await apiClient.post('/cabinet/auth/email/verify', { token })
|
const response = await apiClient.post<AuthResponse>('/cabinet/auth/email/verify', { token })
|
||||||
return response.data
|
return response.data
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user