@@ -38,8 +38,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
3838 credentialProvider. identifier = serviceIdentifiers. first
3939 let url = serviceIdentifiers. first. flatMap { URL ( string: $0. identifier) }
4040 passwordsViewController. navigationItem. prompt = url? . host
41- let keywords = url? . host? . sanitizedDomain? . components ( separatedBy: " . " ) ?? [ ]
42- passwordsViewController. showPasswordsWithSuggstion ( keywords)
41+ passwordsViewController. showPasswordsWithSuggstion ( matching: url? . host ?? " " )
4342 }
4443
4544 override func provideCredentialWithoutUserInteraction( for credentialIdentity: ASPasswordCredentialIdentity ) {
@@ -57,7 +56,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
5756 }
5857 credentialProvider. identifier = credentialIdentity. serviceIdentifier
5958 passwordsViewController. navigationItem. prompt = identifier
60- passwordsViewController. showPasswordsWithSuggstion ( [ identifier] )
59+ passwordsViewController. showPasswordsWithSuggstion ( matching : identifier)
6160 }
6261}
6362
@@ -68,14 +67,3 @@ extension CredentialProviderViewController: PasswordSelectionDelegate {
6867 credentialProvider. persistAndProvideCredentials ( with: passwordEntity. getPath ( ) )
6968 }
7069}
71-
72- private extension String {
73- var sanitizedDomain : String ? {
74- replacingOccurrences ( of: " .com " , with: " " )
75- . replacingOccurrences ( of: " .org " , with: " " )
76- . replacingOccurrences ( of: " .edu " , with: " " )
77- . replacingOccurrences ( of: " .net " , with: " " )
78- . replacingOccurrences ( of: " .gov " , with: " " )
79- . replacingOccurrences ( of: " www. " , with: " " )
80- }
81- }
0 commit comments