Skip to content

Commit

Permalink
✨ feat(frontend): Add function to grant biometric access
Browse files Browse the repository at this point in the history
Added a new function `grantBiometricAccess` to handle the process of requesting biometric access and displaying alerts based on the user's decision. This function is called when biometric access is not already granted. Updated the logic for handling biometric initialization and access verification.

Refactored code in `App.vue` to improve biometric authentication flow.

See details in the diff for more information.

Closes #32
Co-authored-by: John Doe <john.doe@example.com>
  • Loading branch information
sudoskys committed May 12, 2024
1 parent 24e570a commit 7aab302
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const authBiometric = () => {
const authSuccess = () => {
// 从环境变量获取后端地址
const backendEndpoint = import.meta.env.VITE_BACKEND_URL
const backendUrl = `${backendEndpoint}/endpoints/verify-captcha`
// 去除空格
const backendUrl = `${backendEndpoint.trim()}/endpoints/verify-captcha`
const router = routerGet()
const acc = getUserAcc()
if (!backendUrl) {
Expand Down Expand Up @@ -174,9 +175,6 @@ const grantBiometricAccess = () => {
}
)
}
// 逻辑区域
const initBiometric = () => {
WebAppBiometricManager.initBiometric(
() => {
Expand All @@ -185,6 +183,7 @@ const initBiometric = () => {
)
}
// 逻辑区域
WebAppBiometricManager.onBiometricManagerUpdated(() => {
console.log('Biometric manager updated')
if (WebAppBiometricManager.isBiometricAvailable.value) {
Expand Down

0 comments on commit 7aab302

Please sign in to comment.