Update auth.ts

This commit is contained in:
Egor
2026-01-25 09:25:27 +03:00
committed by GitHub
parent 3f9c687f37
commit cb1476f808

View File

@@ -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
}, },