mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 10:19:43 +00:00
Verify identity when enabling biometric auth
- Prompt for biometric authentication before enabling feature - Add error handling for failed authentication - Update .gitignore to exclude .opencode directory
This commit is contained in:
1 parent
5a7488bd62
commit
d62fd1c053
2 files changed
+21
-2
No files matched your search
@@ -54,3 +54,6 @@ coverage/
|
||||
.tmp/
|
||||
*.tmp
|
||||
nul
|
||||
|
||||
# Opencode
|
||||
.opencode/
|
||||
@@ -277,11 +277,27 @@ export function useProfileSettings() {
|
||||
};
|
||||
|
||||
const handleBiometricToggle = async (value: boolean) => {
|
||||
setBiometricEnabledState(value);
|
||||
setIsUpdatingBiometric(true);
|
||||
|
||||
try {
|
||||
await setBiometricEnabled(value);
|
||||
if (value) {
|
||||
const { authenticateWithBiometric } = await import('../../../lib/biometricAuth');
|
||||
const success = await authenticateWithBiometric();
|
||||
|
||||
if (!success) {
|
||||
Alert.alert(
|
||||
"Authentication Failed",
|
||||
`Could not verify your ${biometricType}. Please try again.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await setBiometricEnabled(true);
|
||||
setBiometricEnabledState(true);
|
||||
} else {
|
||||
await setBiometricEnabled(false);
|
||||
setBiometricEnabledState(false);
|
||||
}
|
||||
} catch (error) {
|
||||
setBiometricEnabledState(!value);
|
||||
Alert.alert("Error", `Failed to ${value ? "enable" : "disable"} ${biometricType}. Please try again.`);
|
||||
|
||||
Reference in new issue
Block a user