Added authentication when pressing the Share QR, edit and delete button (#277)

This commit is contained in:
Vishnu Mohandas 2023-10-06 22:11:24 +05:30 committed by GitHub
commit ea1827d963
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 77 additions and 19 deletions

View file

@ -267,5 +267,8 @@
"thisWillLogYouOutOfTheFollowingDevice": "Dadurch wirst du von folgendem Gerät abgemeldet:",
"terminateSession": "Sitzungen beenden?",
"terminate": "Beenden",
"thisDevice": "Dieses Gerät"
"thisDevice": "Dieses Gerät",
"editCodeAuthMessage": "Authentifizieren, um Code zu bearbeiten",
"deleteCodeAuthMessage": "Authentifizieren, um Code zu löschen",
"showQRAuthMessage": "Authentifizieren, um QR-Code anzuzeigen"
}

View file

@ -333,5 +333,8 @@
"shouldHideCode": "Hide codes",
"focusOnSearchBar": "Focus search on app start",
"confirmUpdatingkey": "Are you sure you want to update the secret key?",
"minimizeAppOnCopy": "Minimize app on copy"
"minimizeAppOnCopy": "Minimize app on copy",
"editCodeAuthMessage": "Authenticate to edit code",
"deleteCodeAuthMessage": "Authenticate to delete code",
"showQRAuthMessage": "Authenticate to show QR code"
}

View file

@ -226,5 +226,8 @@
"authToExportCodes": "Por favor, autentifíquese para exportar sus códigos",
"sorry": "Lo sentimos",
"importFailureDesc": "No se pudo analizar el archivo seleccionado.\n¡Por favor escriba a support@ente.io si necesita ayuda!",
"pendingSyncs": "Atención"
"pendingSyncs": "Atención",
"editCodeAuthMessage": "Autenticar para editar código",
"deleteCodeAuthMessage": "Autenticar para borrar código",
"showQRAuthMessage": "Autenticar para mostrar código QR"
}

View file

@ -231,5 +231,8 @@
"importFailureDesc": "نتوانستیم فایل انتخابی را تجزیه و تحلیل کنیم.\nاگر به کمک نیاز دارید، لطفا به support@ente.io ایمیل بزنید!",
"pendingSyncs": "اخطار",
"pendingSyncsWarningBody": "برخی از کدهای شما پشتیبان گیری نشده اند.\n\nلطفا قبل از خروج، مطمئن شوید که یک نسخه پشتیبان برای این کدها دارید.",
"thisDevice": "این دستگاه"
"thisDevice": "این دستگاه",
"editCodeAuthMessage": "احراز هویت برای ویرایش کد",
"deleteCodeAuthMessage": "احراز هویت برای حذف کد",
"showQRAuthMessage": "احراز هویت برای نمایش کد QR"
}

View file

@ -119,5 +119,8 @@
"moderateStrength": "Kohtalainen salasana",
"confirmPassword": "Vahvista salasana",
"close": "Sulje",
"oopsSomethingWentWrong": "Hupsista! Jotakin meni nyt pieleen."
"oopsSomethingWentWrong": "Hupsista! Jotakin meni nyt pieleen.",
"editCodeAuthMessage": "Autentikoidu muokataksesi koodia",
"deleteCodeAuthMessage": "Autentikoidu poistaaksesi koodin",
"showQRAuthMessage": "Autentikoidu näyttääksesi QR-koodin"
}

View file

@ -330,5 +330,8 @@
"offlineModeWarning": "Vous avez choisi de procéder sans sauvegarde. Veuillez prendre des sauvegardes manuelles pour vous assurer que vos codes sont sûrs.",
"showLargeIcons": "Afficher les grandes icônes",
"shouldHideCode": "Cacher les codes",
"focusOnSearchBar": "Cibler le champ de recherche au démarrage de l'application"
"focusOnSearchBar": "Cibler le champ de recherche au démarrage de l'application",
"editCodeAuthMessage": "Authentification requise pour modifier le code",
"deleteCodeAuthMessage": "Authentification requise pour supprimer le code",
"showQRAuthMessage": "Authentification requise pour afficher le code QR"
}

View file

@ -333,5 +333,8 @@
"shouldHideCode": "Nascondi i codici",
"focusOnSearchBar": "Apri ricerca all'avvio dell'app",
"confirmUpdatingkey": "Sei sicuro di voler aggiornare la chiave segreta?",
"minimizeAppOnCopy": "Riduci a icona l'app dopo la copia"
"minimizeAppOnCopy": "Riduci a icona l'app dopo la copia",
"editCodeAuthMessage": "Autenticarsi per modificare il codice",
"deleteCodeAuthMessage": "Autenticarsi per cancellare il codice",
"showQRAuthMessage": "Autenticarsi per mostrare il codice QR"
}

View file

@ -263,5 +263,8 @@
"thisWillLogYouOutOfTheFollowingDevice": "以下のデバイスからログアウトします:",
"terminateSession": "セッションを終了しますか?",
"terminate": "終了",
"thisDevice": "このデバイス"
"thisDevice": "このデバイス",
"editCodeAuthMessage": "コードを編集するには認証が必要です",
"deleteCodeAuthMessage": "コードを削除するには認証が必要です",
"showQRAuthMessage": "QRコードを表示するには認証が必要です"
}

View file

@ -329,5 +329,8 @@
"sigInBackupReminder": "Exporteer de codes zodat je een back-up hebt waarvandaan je kan herstellen.",
"offlineModeWarning": "Je hebt ervoor gekozen om verder te gaan zonder back-ups. Neem handmatige back-ups om ervoor te zorgen dat jouw codes veilig zijn.",
"showLargeIcons": "Grote iconen",
"focusOnSearchBar": "Focus zoekveld na starten app"
"focusOnSearchBar": "Focus zoekveld na starten app",
"editCodeAuthMessage": "Authenticeren om code te bewerken",
"deleteCodeAuthMessage": "Authenticeren om code te verwijderen",
"showQRAuthMessage": "Authenticeren om QR-code te tonen"
}

View file

@ -263,5 +263,8 @@
"thisWillLogYouOutOfTheFollowingDevice": "To wyloguje Cię z tego urządzenia:",
"terminateSession": "Zakończyć sesję?",
"terminate": "Zakończ",
"thisDevice": "To urządzenie"
"thisDevice": "To urządzenie",
"editCodeAuthMessage": "Uwierzytelnij, aby edytować kod",
"deleteCodeAuthMessage": "Uwierzytelnij, aby usunąć kod",
"showQRAuthMessage": "Uwierzytelnij, aby pokazać kod QR"
}

View file

@ -223,5 +223,8 @@
"sorry": "Desculpe",
"importFailureDesc": "Não foi possível analisar o arquivo selecionado.\nPor favor, escreva para support@ente.io se precisar de ajuda!",
"pendingSyncs": "Atenção",
"pendingSyncsWarningBody": "Alguns de seus códigos não foram salvos.\n\nPor favor, certifique-se que você possui um backup para esses códigos antes de sair."
"pendingSyncsWarningBody": "Alguns de seus códigos não foram salvos.\n\nPor favor, certifique-se que você possui um backup para esses códigos antes de sair.",
"editCodeAuthMessage": "Autenticar para editar o código",
"deleteCodeAuthMessage": "Autenticar para excluir o código",
"showQRAuthMessage": "Autenticar para mostrar o QR Code"
}

View file

@ -316,5 +316,8 @@
"encrypted": "Зашифрованный",
"plainText": "Обычный текст",
"passwordToEncryptExport": "Пароль для шифрования экспорта",
"export": "Экспорт"
"export": "Экспорт",
"editCodeAuthMessage": "Аутентификация для редактирования кода",
"deleteCodeAuthMessage": "Аутентификация для удаления кода",
"showQRAuthMessage": "Аутентификация для отображения QR-кода"
}

View file

@ -314,5 +314,8 @@
"encrypted": "Şifreli",
"plainText": "Düz metin",
"passwordToEncryptExport": "Dışa aktarımı şifrelemek için parola",
"export": "Dışa aktar"
"export": "Dışa aktar",
"editCodeAuthMessage": "Kodu düzenlemek için doğrulama yapın",
"deleteCodeAuthMessage": "Kodu silmek için doğrulama yapın",
"showQRAuthMessage": "QR kodunu göstermek için doğrulama yapın"
}

View file

@ -267,5 +267,8 @@
"thisWillLogYouOutOfTheFollowingDevice": "Thao tác này sẽ đăng xuất bạn khỏi thiết bị sau:",
"terminateSession": "Chấm dứt phiên?",
"terminate": "Dừng lại",
"thisDevice": "Thiết bị này"
"thisDevice": "Thiết bị này",
"editCodeAuthMessage": "Xác minh để chỉnh sửa mã",
"deleteCodeAuthMessage": "Xác minh để xóa mã",
"showQRAuthMessage": "Xác minh để hiển thị mã QR"
}

View file

@ -333,5 +333,8 @@
"shouldHideCode": "隐藏代码",
"focusOnSearchBar": "应用启动后聚焦搜索",
"confirmUpdatingkey": "您确定要更新此密钥吗?",
"minimizeAppOnCopy": "复制时最小化应用"
"minimizeAppOnCopy": "复制时最小化应用",
"editCodeAuthMessage": "编辑代码需要身份验证",
"deleteCodeAuthMessage": "删除代码需要身份验证",
"showQRAuthMessage": "显示QR码需要身份验证"
}

View file

@ -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(context.l10n.editCodeAuthMessage);
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(context.l10n.showQRAuthMessage);
if(!_isAuthSuccessful) {
return;
}
// ignore: unused_local_variable
final Code? code = await Navigator.of(context).push(
MaterialPageRoute(
@ -394,6 +403,10 @@ class _CodeWidgetState extends State<CodeWidget> {
}
void _onDeletePressed(_) async {
bool _isAuthSuccessful = await requestAuthentication(context.l10n.deleteCodeAuthMessage);
if(!_isAuthSuccessful) {
return;
}
final l10n = context.l10n;
await showChoiceActionSheet(
context,

View file

@ -755,10 +755,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: transitive
description:
@ -1654,4 +1654,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0"
flutter: ">=3.10.0"

View file

@ -51,7 +51,7 @@ dependencies:
http: ^0.13.4
intl: ^0.18.0
json_annotation: ^4.5.0
local_auth: ^2.1.3
local_auth: ^2.1.7
logging: ^1.0.1
modal_bottom_sheet: ^3.0.0-pre
move_to_background: ^1.0.2