mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-05 08:46:21 +00:00
新增腾讯天御验证码认证门禁
This commit is contained in:
1 parent
825ca7b1fc
commit
e592c5f9e0
86 files changed
+3683
-262
No files matched your search
@@ -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)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user