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 5e4786b commit 0a1de50
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ const isGyroscopeExist = useGyroscopeExists();
const isAccelerometerExist = useAccelerometerExists();
const routerGet = () => {
if (!route.query.chat_id || !route.query.msg_id || !route.query.timestamp || !route.query.signature) {
if (!route.query.chat_id || !route.query.message_id || !route.query.timestamp || !route.query.signature) {
return null
}
return {
chat_id: route.query.chat_id as string,
message_id: route.query.msg_id as string,
message_id: route.query.message_id as string,
timestamp: route.query.timestamp as string,
signature: route.query.signature as string,
}
Expand Down Expand Up @@ -71,6 +71,9 @@ const getUserAcc = () => {
}
}
const openAuthSettings = () => {
if (!WebAppBiometricManager.isBiometricInited.value) {
return WebAppPopup.showAlert('Biometric not initialized')
}
WebAppBiometricManager.openBiometricSettings()
}
const authBiometric = () => {
Expand Down Expand Up @@ -156,6 +159,9 @@ const authSuccess = () => {
})
}
const grantBiometricAccess = () => {
if (!WebAppBiometricManager.isBiometricInited.value) {
return WebAppPopup.showAlert('Biometric not initialized')
}
WebAppBiometricManager.requestBiometricAccess(
{reason: 'Please authenticate to continue'},
(isAccessGranted: boolean) => {
Expand Down

0 comments on commit 0a1de50

Please sign in to comment.