From 6ba9ed9f8d4a185927a2ce33570b77ddd0183be4 Mon Sep 17 00:00:00 2001 From: Aman Raj Singh Mourya Date: Mon, 23 Sep 2024 15:11:20 +0530 Subject: [PATCH 1/2] [auth] authentication to view passkey --- auth/lib/ui/settings/security_section_widget.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/auth/lib/ui/settings/security_section_widget.dart b/auth/lib/ui/settings/security_section_widget.dart index 38fa19f4a4..09dc14876a 100644 --- a/auth/lib/ui/settings/security_section_widget.dart +++ b/auth/lib/ui/settings/security_section_widget.dart @@ -101,7 +101,18 @@ class _SecuritySectionWidgetState extends State { pressedColor: getEnteColorScheme(context).fillFaint, trailingIcon: Icons.chevron_right_outlined, trailingIconIsMuted: true, - onTap: () async => await onPasskeyClick(context), + onTap: () async { + final bool hasAuthenticated = await LocalAuthenticationService + .instance + .requestLocalAuthentication( + context, + context.l10n.authToViewPasskey, + ); + await PlatformUtil.refocusWindows(); + if (hasAuthenticated) { + await onPasskeyClick(context); + } + }, ), sectionOptionSpacing, MenuItemWidget( From 27defa92c27b3b8d83b45a23f8cc78f266f68525 Mon Sep 17 00:00:00 2001 From: Aman Raj Singh Mourya Date: Mon, 23 Sep 2024 15:12:15 +0530 Subject: [PATCH 2/2] [auth] extract strings --- auth/lib/l10n/arb/app_en.arb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/auth/lib/l10n/arb/app_en.arb b/auth/lib/l10n/arb/app_en.arb index 78f111d6a9..a132d48e21 100644 --- a/auth/lib/l10n/arb/app_en.arb +++ b/auth/lib/l10n/arb/app_en.arb @@ -23,16 +23,16 @@ "all": "All", "notes": "Notes", "notesLengthLimit": "Notes can be at most {count} characters long", - "@notesLengthLimit": { - "description": "Text to indicate the maximum number of characters allowed for notes", - "placeholders": { - "count": { - "description": "The maximum number of characters allowed for notes", - "type": "int", - "example": "100" - } - } - }, + "@notesLengthLimit": { + "description": "Text to indicate the maximum number of characters allowed for notes", + "placeholders": { + "count": { + "description": "The maximum number of characters allowed for notes", + "type": "int", + "example": "100" + } + } + }, "codeAccountHint": "Account (you@domain.com)", "codeTagHint": "Tag", "accountKeyType": "Type of key", @@ -492,5 +492,6 @@ "setNewPin": "Set new PIN", "importFailureDescNew": "Could not parse the selected file.", "appLockNotEnabled": "App lock not enabled", - "appLockNotEnabledDescription": "Please enable app lock from Security > App Lock" + "appLockNotEnabledDescription": "Please enable app lock from Security > App Lock", + "authToViewPasskey": "Please authenticate to view passkey" } \ No newline at end of file