新增腾讯天御验证码认证门禁

This commit is contained in:
lyen1688 committed 2026-08-04 15:09:29 +08:00
1 parent 825ca7b1fc
commit e592c5f9e0
86 files changed
+3683 -262

No files matched your search

+5 -5
View File
@@ -1,5 +1,5 @@
import { apiClient } from './client'
import type { AuthResponse } from '@/types'
import type { AuthResponse, TencentCaptchaRequestProof } from '@/types'
export interface PasskeyCredentialSummary {
id: number
@@ -104,11 +104,11 @@ function serializeAssertionCredential(credential: PublicKeyCredential): Record<s
}
}
async function login(): Promise<AuthResponse> {
async function login(proof?: TencentCaptchaRequestProof): Promise<AuthResponse> {
requirePasskeySupport()
const { data: begin } = await apiClient.post<CeremonyOptionsResponse>(
'/auth/passkey/login/begin'
)
const { data: begin } = proof
? await apiClient.post<CeremonyOptionsResponse>('/auth/passkey/login/begin', proof)
: await apiClient.post<CeremonyOptionsResponse>('/auth/passkey/login/begin')
const credential = await navigator.credentials.get({
publicKey: requestOptionsFromJSON(begin.options.publicKey)
})