feat: create kyc page with api

This commit is contained in:
2026-05-12 18:04:33 +03:00
parent f52365c293
commit ed9d33e386
6 changed files with 39 additions and 18 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View File

@@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
<script type="module" crossorigin src="/assets/index-DNMSK_QC.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Gd4LQhAo.css">
<script type="module" crossorigin src="/assets/index-DnBv2hbv.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-3J8Zo9Sf.css">
</head>
<body>
<div id="root"></div>

View File

@@ -9,5 +9,7 @@ export function useAuth() {
queryFn: refreshAccessToken,
retry: false,
staleTime: Infinity,
gcTime: Infinity,
refetchOnWindowFocus: false,
})
}

View File

@@ -1,4 +1,6 @@
import { api } from '@shared/api/base'
import { KYC_API_URL } from '@shared/config/env'
import { getCsrfToken } from '@shared/api/csrf'
import { tokenStore } from '@shared/api/tokenStore'
export interface KycResponse {
status: boolean
@@ -9,6 +11,22 @@ export interface KycResponse {
qr_code: string
}
export function kycCreate(): Promise<KycResponse> {
return api.post<KycResponse>('/kyc/create', {})
export async function kycCreate(): Promise<KycResponse> {
const csrf = await getCsrfToken()
const bearer = tokenStore.get()
const res = await fetch(`${KYC_API_URL}/kyc/create`, {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf,
...(bearer ? { Authorization: `Bearer ${bearer}` } : {}),
},
body: JSON.stringify({}),
})
const data = await res.json()
if (!res.ok) throw data
return data as KycResponse
}

View File

@@ -1 +1,2 @@
export const API_URL = import.meta.env.VITE_API_URL as string
export const KYC_API_URL = import.meta.env.VITE_KYC_API_URL as string