Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit f29d884

Browse files
authored
Fixes issue where "Use Security Key" option should not be present (#820)
2 parents 488d905 + 359d555 commit f29d884

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

WordPressAuthenticator/Signin/LoginViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ open class LoginViewController: NUXViewController, LoginFacadeDelegate {
216216
return
217217
}
218218

219+
// Make sure we don't provide any old nonce information when we are required to present only the multi-factor code option.
220+
loginFields.nonceInfo = nil
221+
loginFields.nonceUserID = 0
222+
219223
presentUnified2FA()
220224
}
221225

WordPressAuthenticator/Unified Auth/View Related/2FA/TwoFAViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ private extension TwoFAViewController {
491491
rows.append(.spacer(4))
492492
rows.append(.sendCode)
493493

494-
if #available(iOS 16, *), WordPressAuthenticator.shared.configuration.enablePasskeys, loginFields.nonceInfo?.nonceWebauthn != nil {
494+
if #available(iOS 16, *), WordPressAuthenticator.shared.configuration.enablePasskeys, loginFields.nonceInfo?.nonceWebauthn.isEmpty == false {
495495
rows.append(.spacer(4))
496496
rows.append(.enterSecurityKey)
497497
}

0 commit comments

Comments
 (0)