mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-26 22:03:55 +03:00
Show error message on invalid QR code.
This commit is contained in:
parent
d59cb0f9cd
commit
01cc8aa6f7
@ -70,7 +70,13 @@ Future<void> handleUri(
|
|||||||
OathState? state,
|
OathState? state,
|
||||||
AppLocalizations l10n,
|
AppLocalizations l10n,
|
||||||
) async {
|
) async {
|
||||||
List<CredentialData> creds = CredentialData.fromUri(Uri.parse(qrData));
|
List<CredentialData> creds;
|
||||||
|
try {
|
||||||
|
creds = CredentialData.fromUri(Uri.parse(qrData));
|
||||||
|
} catch (_) {
|
||||||
|
showMessage(context, l10n.l_invalid_qr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (creds.isEmpty) {
|
if (creds.isEmpty) {
|
||||||
showMessage(context, l10n.l_qr_not_found);
|
showMessage(context, l10n.l_qr_not_found);
|
||||||
} else if (creds.length == 1) {
|
} else if (creds.length == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user