()
| 90 | }, |
| 91 | |
| 92 | async getGenericPassword() { |
| 93 | if (instance) { |
| 94 | try { |
| 95 | instance.isAuthenticating = true; |
| 96 | const keychainObject = await Keychain.getGenericPassword( |
| 97 | defaultOptions, |
| 98 | ); |
| 99 | if (keychainObject.password) { |
| 100 | const encryptedPassword = keychainObject.password; |
| 101 | const decrypted = await instance.decryptPassword(encryptedPassword); |
| 102 | keychainObject.password = decrypted.password; |
| 103 | instance.isAuthenticating = false; |
| 104 | return keychainObject; |
| 105 | } |
| 106 | instance.isAuthenticating = false; |
| 107 | } catch (error) { |
| 108 | instance.isAuthenticating = false; |
| 109 | throw new Error(error.message); |
| 110 | } |
| 111 | } |
| 112 | return null; |
| 113 | }, |
| 114 | |
| 115 | async setGenericPassword(password, type) { |
| 116 | const authOptions = { |
nothing calls this directly
no test coverage detected