Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch exception during biometrics process and fallback to PIN dialog in this case. #1610

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

clangenb
Copy link
Member

No description provided.

@@ -50,7 +49,13 @@ final class LoginService {
await secureStorage.write(key: pinStorageKey, value: pin);
}

Future<void> clearPin() => secureStorage.clear();
Copy link
Member Author

@clangenb clangenb Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was dangerous, it clears the entire secure storage associated with the application. This was harmless now, as we don't store anything else currently, but later we intend to store the account seeds there too.

Future<bool> localAuthenticate(String localizedReason, [bool stickyAuth = false]) {
try {
return localAuthentication.authenticate(
localizedReason: localizedReason,
options: AuthenticationOptions(useErrorDialogs: false, stickyAuth: stickyAuth),
);
} catch (e, s) {
Log.e('$e', 'LoginStore', s);
return Future.value(false);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might have been the reason that on some phones the authentication didn't work any more. We swallowed the exception, and returned false for authentication failed.

@clangenb clangenb added A2-technical PR introduces technical changes B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes labels Dec 18, 2023
@clangenb clangenb changed the title Catch exception during biometrics process Catch exception during biometrics process and fallback to PIN dialog in this case. Dec 18, 2023
@clangenb clangenb merged commit f2c2a60 into master Dec 18, 2023
19 of 26 checks passed
@clangenb clangenb deleted the cl/fix-pin-handling branch December 18, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-technical PR introduces technical changes B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant