feat: похуйу

This commit is contained in:
2026-05-12 22:18:45 +03:00
parent 929d455b30
commit a43c75a3df
5 changed files with 50 additions and 20 deletions

View File

@@ -1,17 +1,33 @@
import { getCsrfToken } from '@shared/api/csrf'
import { tokenStore } from '@shared/api/tokenStore'
const USERS_API_URL = 'https://app.users.elcsa.ru'
export async function getMe(): Promise<unknown> {
export interface MeResponse {
id: string
email: string
first_name: string
middle_name: string
last_name: string
birth_date: string
crypto_wallet: string | null
phone: string
passport_data: string | null
inn: string | null
erc20: string | null
kyc_verified: boolean
is_deleted: boolean
created_at: string
updated_at: string
kyc_verified_at: string | null
}
export async function getMe(): Promise<MeResponse> {
const csrf = await getCsrfToken()
const bearer = tokenStore.get()
const res = await fetch(`${USERS_API_URL}/me/`, {
credentials: 'include',
headers: {
'X-CSRF-Token': csrf,
...(bearer ? { Authorization: `Bearer ${bearer}` } : {}),
},
})