diff --git a/Client/U2FExtensions.swift b/Client/U2FExtensions.swift index 299567d0694..8d8087af76e 100644 --- a/Client/U2FExtensions.swift +++ b/Client/U2FExtensions.swift @@ -99,7 +99,7 @@ class U2FExtensions: NSObject { /// Show to enter key's pin fileprivate let pinVerificationPopup = AlertPopupView(imageView: UIImageView(image: #imageLiteral(resourceName: "enter_pin")), - title: Strings.pinTitle, message: "", + title: Strings.pinTitle, message: Strings.pinMessage, inputType: .default, secureInput: true, inputPlaceholder: Strings.pinPlaceholder) @@ -650,6 +650,8 @@ class U2FExtensions: NSObject { // This modal is presented when FIDO/FIDO2 APIs are waiting for the security key private func presentInsertKeyModal() { + let currentURL = self.tab?.url?.host ?? "" + insertKeyPopup.update(title: Strings.insertKeyMessage + currentURL) insertKeyPopup.showWithType(showType: .flyUp) } @@ -665,6 +667,8 @@ class U2FExtensions: NSObject { // The modal should be visible for the tab where the U2F API is active if u2fActive && tab?.id == currentTabId && (fido2Service.keyState == .touchKey || u2fService.keyState == .YKFKeyU2FServiceKeyStateTouchKey) { + let currentURL = self.tab?.url?.host ?? "" + touchKeyPopup.update(title: Strings.touchKeyMessage + currentURL) touchKeyPopup.showWithType(showType: .flyUp) return } @@ -673,10 +677,13 @@ class U2FExtensions: NSObject { private func handlePinVerificationRequired(completion: @escaping (Bool) -> Void) { ensureMainThread { + let currentURL = self.tab?.url?.host ?? "" self.pinVerificationPopup.addButton(title: Strings.confirmPin, type: .primary) { [weak self] in + self?.verificationPendingPopup.update(title: Strings.verificationPending + currentURL) self?.verificationPendingPopup.showWithType(showType: .flyUp) return self?.verifyPin(completion: completion) ?? .flyDown } + self.pinVerificationPopup.update(title: Strings.pinTitle + currentURL) self.pinVerificationPopup.showWithType(showType: .flyUp) } } @@ -1173,15 +1180,16 @@ extension Strings { public static let U2FAuthenticationError = NSLocalizedString("U2FAuthenticationError", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Error authenticating your security key", comment: "Error handling U2F authentication.") + tryAgain //Lightning Modals - public static let touchKeyMessage = NSLocalizedString("touchKeyMessage", bundle: Bundle.shared, value: "Touch your key to finish.", comment: "Message for touch key modal.") - public static let insertKeyMessage = NSLocalizedString("insertKeyMessage", bundle: Bundle.shared, value: "Insert your security key.", comment: "Message for touch key modal.") + public static let touchKeyMessage = NSLocalizedString("touchKeyMessage", bundle: Bundle.shared, value: "Touch key to finish request for ", comment: "Message for touch key modal.") + public static let insertKeyMessage = NSLocalizedString("insertKeyMessage", bundle: Bundle.shared, value: "Insert security key for ", comment: "Message for touch key modal.") public static let keyCancel = NSLocalizedString("touchKeyCancel", bundle: Bundle.shared, value: "Cancel", comment: "Text for touch key modal button.") //PIN - public static let pinTitle = NSLocalizedString("pinTitle", bundle: Bundle.shared, value: "PIN verification required", comment: "Title for the alert modal when a security key with PIN is inserted.") - public static let pinPlaceholder = NSLocalizedString("pinPlaceholder", bundle: Bundle.shared, value: "Enter your security key PIN", comment: "Placeholder text for PIN") + public static let pinTitle = NSLocalizedString("pinTitle", bundle: Bundle.shared, value: "PIN verification for ", comment: "Title for the alert modal when a security key with PIN is inserted.") + public static let pinMessage = NSLocalizedString("pinMessage", bundle: Bundle.shared, value: "Enter the PIN for your security key", comment: "Placeholder text for PIN") + public static let pinPlaceholder = NSLocalizedString("pinPlaceholder", bundle: Bundle.shared, value: "PIN", comment: "Placeholder text for PIN") public static let confirmPin = NSLocalizedString("confirmPin", bundle: Bundle.shared, value: "Verify", comment: "Button text to confirm PIN") - public static let verificationPending = NSLocalizedString("verificationPending", bundle: Bundle.shared, value: "Verifying your PIN...", comment: "Title when PIN code is being verified.") + public static let verificationPending = NSLocalizedString("verificationPending", bundle: Bundle.shared, value: "Verifying your PIN for ", comment: "Title when PIN code is being verified.") } extension String {