@capgo/capacitor-autofill-save-password 8.0.22 → 8.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,7 +51,7 @@ dependencies {
51
51
  implementation fileTree(dir: 'libs', include: ['*.jar'])
52
52
  implementation project(':capacitor-android')
53
53
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
54
- implementation "androidx.credentials:credentials:1.5.0"
54
+ implementation "androidx.credentials:credentials:1.6.0"
55
55
  implementation "androidx.credentials:credentials-play-services-auth:1.5.0"
56
56
  testImplementation "junit:junit:$junitVersion"
57
57
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
@@ -28,7 +28,7 @@ import java.util.Map;
28
28
  @CapacitorPlugin(name = "SavePassword")
29
29
  public class SavePasswordPlugin extends Plugin {
30
30
 
31
- private final String pluginVersion = "8.0.22";
31
+ private final String pluginVersion = "8.0.24";
32
32
  private static final String TAG = "CredentialManager";
33
33
  private CredentialManager credentialManager;
34
34
  private Map<String, PendingGetCredentialRequest> pendingRequestsByElementId = new HashMap<>();
@@ -9,7 +9,7 @@ import AuthenticationServices
9
9
  */
10
10
  @objc(SavePasswordPlugin)
11
11
  public class SavePasswordPlugin: CAPPlugin, CAPBridgedPlugin, ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding {
12
- private let pluginVersion: String = "8.0.22"
12
+ private let pluginVersion: String = "8.0.24"
13
13
  public let identifier = "SavePasswordPlugin"
14
14
 
15
15
  public let jsName = "SavePassword"
@@ -48,16 +48,17 @@ public class SavePasswordPlugin: CAPPlugin, CAPBridgedPlugin, ASAuthorizationCon
48
48
  @objc func readPassword(_ call: CAPPluginCall) {
49
49
  DispatchQueue.main.async {
50
50
  let passwordRequest = ASAuthorizationPasswordProvider().createRequest()
51
- let authController = ASAuthorizationController(authorizationRequests: [passwordRequest])
51
+ self.authController = ASAuthorizationController(authorizationRequests: [passwordRequest])
52
52
  self.currentReadCall = call
53
- authController.delegate = self
54
- authController.presentationContextProvider = self
55
- authController.performRequests()
53
+ self.authController?.delegate = self
54
+ self.authController?.presentationContextProvider = self
55
+ self.authController?.performRequests()
56
56
  }
57
57
  }
58
58
 
59
59
  private var currentReadCall: CAPPluginCall?
60
60
  private var currentCall: CAPPluginCall?
61
+ private var authController: ASAuthorizationController?
61
62
 
62
63
  public func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
63
64
  if let passwordCredential = authorization.credential as? ASPasswordCredential {
@@ -79,6 +80,7 @@ public class SavePasswordPlugin: CAPPlugin, CAPBridgedPlugin, ASAuthorizationCon
79
80
  currentCall?.resolve()
80
81
  currentCall = nil
81
82
  }
83
+ self.authController = nil
82
84
  }
83
85
 
84
86
  public func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
@@ -89,6 +91,7 @@ public class SavePasswordPlugin: CAPPlugin, CAPBridgedPlugin, ASAuthorizationCon
89
91
  }
90
92
  currentCall?.reject("Autofill failed", error.localizedDescription)
91
93
  currentCall = nil
94
+ self.authController = nil
92
95
  }
93
96
 
94
97
  // MARK: - ASAuthorizationControllerPresentationContextProviding
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-autofill-save-password",
3
- "version": "8.0.22",
3
+ "version": "8.0.24",
4
4
  "description": "Prompt to display dialog for saving password to keychain from webview app",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",