Skip to content

Commit

Permalink
Merge pull request #96 from IamMuuo/local-auth
Browse files Browse the repository at this point in the history
fix: local auth requiring password even on desktop and web
  • Loading branch information
IamMuuo authored Oct 3, 2024
2 parents 22be4f1 + cadc35e commit 43ae0db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 37 deletions.
21 changes: 0 additions & 21 deletions lib/controllers/controller_ready_mixin.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/controllers/controllers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export 'network_controller.dart';
export 'reward_controller.dart';
export 'settings_controller.dart';
export 'notifications_controller.dart';
export 'controller_ready_mixin.dart';
33 changes: 18 additions & 15 deletions lib/controllers/settings_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,25 @@ class SettingsController extends GetxController with StateMixin {
Future<bool> performLocalAuthentication(String reason) async {
bool authenticated = false;

try {
authenticated = await localAuthentication.authenticate(
localizedReason: reason,
options: const AuthenticationOptions(
stickyAuth: true,
sensitiveTransaction: true,
),
);
} on PlatformException catch (e) {
authenticated = false;
debugPrint(e.toString());
} catch (e) {
debugPrint(e.toString());
}
if (Platform.isIOS || Platform.isAndroid) {
try {
authenticated = await localAuthentication.authenticate(
localizedReason: reason,
options: const AuthenticationOptions(
stickyAuth: true,
sensitiveTransaction: true,
),
);
} on PlatformException catch (e) {
authenticated = false;
debugPrint(e.toString());
} catch (e) {
debugPrint(e.toString());
}

return authenticated;
return authenticated;
}
return true;
}

Future<bool> deviceSupportsLocalAuth() async {
Expand Down

0 comments on commit 43ae0db

Please sign in to comment.