π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Added authentication to show QR, edit or delete a code - Used the requestAuthentication function in utils/auth_util.dart to perform the authentication
Shivam Pachchigar62a41c89c634
diff --git a/lib/ui/code_widget.dart b/lib/ui/code_widget.dartindex a26cc20b2b..a3e9a6d4e8 100644--- a/lib/ui/code_widget.dart+++ b/lib/ui/code_widget.dart@@ -12,6 +12,7 @@ import 'package:ente_auth/services/preference_service.dart';import 'package:ente_auth/store/code_store.dart';import 'package:ente_auth/ui/code_timer_progress.dart';import 'package:ente_auth/ui/utils/icon_utils.dart';+import 'package:ente_auth/utils/auth_util.dart';import 'package:ente_auth/utils/dialog_util.dart';import 'package:ente_auth/utils/toast_util.dart';import 'package:ente_auth/utils/totp_util.dart';@@ -370,6 +371,10 @@ class _CodeWidgetState extends State<CodeWidget> {}Future<void> _onEditPressed(_) async {+ bool _isAuthSuccessful = await requestAuthentication("Authorize to shoq QR");+ if(!_isAuthSuccessful) {+ return;+ }final Code? code = await Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) {@@ -383,6 +388,10 @@ class _CodeWidgetState extends State<CodeWidget> {}Future<void> _onShowQrPressed(_) async {+ bool _isAuthSuccessful = await requestAuthentication("Authorize to shoq QR");+ if(!_isAuthSuccessful) {+ return;+ }// ignore: unused_local_variablefinal Code? code = await Navigator.of(context).push(MaterialPageRoute(@@ -394,6 +403,10 @@ class _CodeWidgetState extends State<CodeWidget> {}void _onDeletePressed(_) async {+ bool _isAuthSuccessful = await requestAuthentication("Authorize to shoq QR");+ if(!_isAuthSuccessful) {+ return;+ }final l10n = context.l10n;await showChoiceActionSheet(context,diff --git a/lib/ui/lifecycle_event_handler.dart b/lib/ui/lifecycle_event_handler.dartindex da5dfb3d97..3873e94981 100644--- a/lib/ui/lifecycle_event_handler.dart+++ b/lib/ui/lifecycle_event_handler.dart@@ -19,7 +19,7 @@ class LifecycleEventHandler extends WidgetsBindingObserver {}break;case AppLifecycleState.inactive:- case AppLifecycleState.hidden:+ // case AppLifecycleState.hidden:case AppLifecycleState.paused:case AppLifecycleState.detached:if (suspendingCallBack != null) {diff --git a/pubspec.lock b/pubspec.lockindex 531462fbb7..d951a419a9 100644--- a/pubspec.lock+++ b/pubspec.lock@@ -197,10 +197,10 @@ packages:dependency: "direct main"description:name: collection- sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687+ sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"url: "https://pub.dev"source: hosted- version: "1.17.2"+ version: "1.17.1"computer:dependency: "direct main"description:@@ -699,10 +699,10 @@ packages:dependency: "direct main"description:name: intl- sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"+ sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6url: "https://pub.dev"source: hosted- version: "0.18.1"+ version: "0.18.0"io:dependency: transitivedescription:@@ -747,10 +747,10 @@ packages:dependency: "direct main"description:name: local_auth- sha256: "0cf238be2bfa51a6c9e7e9cfc11c05ea39f2a3a4d3e5bb255d0ebc917da24401"+ sha256: "7e6c63082e399b61e4af71266b012e767a5d4525dd6e9ba41e174fd42d76e115"url: "https://pub.dev"source: hosted- version: "2.1.6"+ version: "2.1.7"local_auth_android:dependency: transitivedescription:@@ -795,18 +795,18 @@ packages:dependency: transitivedescription:name: matcher- sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"+ sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"url: "https://pub.dev"source: hosted- version: "0.12.16"+ version: "0.12.15"material_color_utilities:dependency: transitivedescription:name: material_color_utilities- sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"+ sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724url: "https://pub.dev"source: hosted- version: "0.5.0"+ version: "0.2.0"meta:dependency: transitivedescription:@@ -1288,10 +1288,10 @@ packages:dependency: transitivedescription:name: source_span- sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"+ sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250url: "https://pub.dev"source: hosted- version: "1.10.0"+ version: "1.9.1"sqflite:dependency: "direct main"description:@@ -1376,26 +1376,26 @@ packages:dependency: transitivedescription:name: test- sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46"+ sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4"url: "https://pub.dev"source: hosted- version: "1.24.3"+ version: "1.24.1"test_api:dependency: transitivedescription:name: test_api- sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"+ sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfburl: "https://pub.dev"source: hosted- version: "0.6.0"+ version: "0.5.1"test_core:dependency: transitivedescription:name: test_core- sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e"+ sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93"url: "https://pub.dev"source: hosted- version: "0.5.3"+ version: "0.5.1"timezone:dependency: transitivedescription:@@ -1580,14 +1580,6 @@ packages:url: "https://pub.dev"source: hostedversion: "1.0.2"- web:- dependency: transitive- description:- name: web- sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10- url: "https://pub.dev"- source: hosted- version: "0.1.4-beta"web_socket_channel:dependency: transitivedescription:@@ -1645,5 +1637,5 @@ packages:source: hostedversion: "3.1.2"sdks:- dart: ">=3.1.0-185.0.dev <4.0.0"- flutter: ">=3.7.0"+ dart: ">=3.0.0 <4.0.0"+ flutter: ">=3.10.0"diff --git a/pubspec.yaml b/pubspec.yamlindex 6284b104f1..51ae26026f 100644--- a/pubspec.yaml+++ b/pubspec.yaml@@ -50,7 +50,7 @@ dependencies:http: ^0.13.4intl: ^0.18.0json_annotation: ^4.5.0- local_auth: ^2.1.3+ local_auth: ^2.1.7logging: ^1.0.1modal_bottom_sheet: ^3.0.0-premove_to_background: ^1.0.2