[auth] Request authentication to view passkeys (#3424)

## Description

## Tests
This commit is contained in:
Neeraj Gupta
2024-09-24 16:01:31 +05:30
committed by GitHub
2 changed files with 24 additions and 12 deletions

View File

@@ -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",
@@ -482,5 +482,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"
}

View File

@@ -101,7 +101,18 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
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(