Skip to content

Commit

Permalink
Added pinDoNotMatch case to FidoViewModelError.
Browse files Browse the repository at this point in the history
  • Loading branch information
jensutbult committed Sep 18, 2024
1 parent bd60939 commit 5f2fa46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
33 changes: 11 additions & 22 deletions Authenticator/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,9 @@
}
}
}
},
"Change password" : {

},
"Change PIN" : {

},
"Change the password for this YubiKey. %@" : {

},
"Clear" : {
"comment" : "Clear password alert button",
Expand Down Expand Up @@ -556,7 +550,7 @@
}
}
},
"Current password" : {
"Current" : {

},
"Current PIN" : {
Expand Down Expand Up @@ -710,6 +704,9 @@
}
}
}
},
"enter current password" : {

},
"enter current PIN" : {

Expand All @@ -730,6 +727,9 @@
}
}
}
},
"enter password" : {

},
"Enter password" : {
"comment" : "Password alert",
Expand Down Expand Up @@ -1107,9 +1107,6 @@
}
}
}
},
"New Password" : {

},
"No account information found!" : {
"comment" : "Scan QR code no account error message",
Expand Down Expand Up @@ -1643,9 +1640,6 @@
}
}
}
},
"Protect this YubiKey with a password." : {

},
"Public key certificates on" : {
"comment" : "PIV extension no certs on device message",
Expand All @@ -1663,6 +1657,9 @@
}
}
}
},
"re-enter password" : {

},
"re-enter PIN" : {

Expand Down Expand Up @@ -1736,6 +1733,7 @@
},
"Remove password" : {
"comment" : "Remove password alert title",
"extractionState" : "stale",
"localizations" : {
"fr" : {
"stringUnit" : {
Expand Down Expand Up @@ -1768,9 +1766,6 @@
}
}
}
},
"Remove the password for this YubiKey." : {

},
"Rename" : {
"comment" : "Menu",
Expand All @@ -1788,9 +1783,6 @@
}
}
}
},
"Repeat new password" : {

},
"Reset" : {
"comment" : "Reset YubiKey alert button",
Expand Down Expand Up @@ -2012,9 +2004,6 @@
},
"Set" : {

},
"Set password" : {

},
"Set PIN" : {

Expand Down
5 changes: 3 additions & 2 deletions Authenticator/Model/FIDOPINViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

enum FidoViewModelError: Error, LocalizedError {

case usbNotSupported, timeout, locked
case usbNotSupported, timeout, locked, pinsDoNotMatch

public var errorDescription: String? {
switch self {
case .pinsDoNotMatch:
return "PINs don't match"
case .usbNotSupported:
return "Fido over USB-C is not supported by iOS. Use NFC or the desktop Yubico Authenticator instead."
case .timeout:
Expand All @@ -33,7 +35,6 @@ enum FidoViewModelError: Error, LocalizedError {
class FIDOPINViewModel: ObservableObject {

@Published var state: PINState = .unknown
@Published var invalidPIN: Bool = false
@Published var isProcessing: Bool = false
@Published var pincomplexity: Bool = false
@Published var minPinLength: UInt = 4
Expand Down

0 comments on commit 5f2fa46

Please sign in to comment.