Fix issues when no PGP passphase and enabling passcode
This commit is contained in:
parent
29d74c48e5
commit
1f2a0e5458
4 changed files with 62 additions and 38 deletions
|
|
@ -43,7 +43,21 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
|
|||
}
|
||||
|
||||
override func provideCredentialWithoutUserInteraction(for credentialIdentity: ASPasswordCredentialIdentity) {
|
||||
credentialProvider.credentials(for: credentialIdentity)
|
||||
credentialProvider.identifier = credentialIdentity.serviceIdentifier
|
||||
if !PasscodeLock.shared.hasPasscode, Defaults.isRememberPGPPassphraseOn {
|
||||
credentialProvider.credentials(for: credentialIdentity)
|
||||
} else {
|
||||
extensionContext.cancelRequest(withError: NSError(domain: ASExtensionErrorDomain, code: ASExtensionError.userInteractionRequired.rawValue))
|
||||
}
|
||||
}
|
||||
|
||||
override func prepareInterfaceToProvideCredential(for credentialIdentity: ASPasswordCredentialIdentity) {
|
||||
guard let identifier = credentialIdentity.recordIdentifier else {
|
||||
return
|
||||
}
|
||||
credentialProvider.identifier = credentialIdentity.serviceIdentifier
|
||||
passwordsViewController.navigationItem.prompt = identifier
|
||||
passwordsViewController.showPasswordsWithSuggstion([identifier])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue