Skip to content

Commit

Permalink
fix wrong prompts when using webauthn with ccid
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Aug 29, 2024
1 parent 239cc0b commit 54c8ec5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ PODS:
- GTMSessionFetcher/Core (< 4.0, >= 3.3.2)
- MLImage (= 1.0.0-beta5)
- MLKitCommon (~> 11.0)
- mobile_scanner (5.1.1):
- mobile_scanner (5.2.1):
- Flutter
- GoogleMLKit/BarcodeScanning (~> 6.0.0)
- nanopb (2.30910.0):
Expand Down Expand Up @@ -195,7 +195,7 @@ SPEC CHECKSUMS:
MLKitBarcodeScanning: 10ca0845a6d15f2f6e911f682a1998b68b973e8b
MLKitCommon: afec63980417d29ffbb4790529a1b0a2291699e1
MLKitVision: e858c5f125ecc288e4a31127928301eaba9ae0c1
mobile_scanner: 8564358885a9253c43f822435b70f9345c87224f
mobile_scanner: 131a34df36b024cc53457809fb991700f16f72d7
nanopb: 438bc412db1928dac798aa6fd75726007be04262
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
16 changes: 8 additions & 8 deletions lib/controller/applets/webauthn.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class WebAuthnController extends Controller {

// PIN is not set
if (_ctap.info.options?['clientPin'] == false) {
// On mobile platforms, we need to finish NFC before showing the dialog
if (isMobile()) {
// When using NFC, we need to finish NFC before showing the dialog
if (SmartCard.useNfc()) {
Prompts.stopPromptPolling();
FlutterNfcKit.finish(closeWebUSB: false);
}
Expand All @@ -63,8 +63,8 @@ class WebAuthnController extends Controller {
prompt: S.of(Get.context!).webauthnSetPinPrompt,
validators: [LengthValidator(min: 4, max: 63)],
);
// On mobile platforms, we need to poll NFC again after showing the dialog
if (isMobile()) {
// When using NFC, we need to poll NFC again after showing the dialog
if (SmartCard.useNfc()) {
Prompts.promptPolling();
await FlutterNfcKit.poll(iosAlertMessage: S.of(Get.context!).iosAlertMessage);
String resp = await FlutterNfcKit.transceive('00A4040008A0000006472F0001');
Expand All @@ -78,8 +78,8 @@ class WebAuthnController extends Controller {
assert(_ctap.info.options?['clientPin'] == true);

if (_pinCache.isEmpty) {
// On mobile platforms, we need to finish NFC before showing the dialog
if (isMobile()) {
// When using NFC, we need to finish NFC before showing the dialog
if (SmartCard.useNfc()) {
Prompts.stopPromptPolling();
FlutterNfcKit.finish(closeWebUSB: false);
}
Expand All @@ -88,8 +88,8 @@ class WebAuthnController extends Controller {
label: 'PIN',
prompt: S.of(Get.context!).webauthnInputPinPrompt,
);
// On mobile platforms, we need to poll NFC again after showing the dialog
if (isMobile()) {
// When using NFC, we need to poll NFC again after showing the dialog
if (SmartCard.useNfc()) {
Prompts.promptPolling();
await FlutterNfcKit.poll(iosAlertMessage: S.of(Get.context!).iosAlertMessage);
String resp = await FlutterNfcKit.transceive('00A4040008A0000006472F0001');
Expand Down

0 comments on commit 54c8ec5

Please sign in to comment.