Skip to content

Commit

Permalink
Allow to override key in keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Jul 29, 2022
1 parent 34af3e4 commit 71fb806
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/WalletConnectKMS/Keychain/KeychainStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public final class KeychainStorage: KeychainStorageProtocol {

let status = secItem.add(query as CFDictionary, nil)

guard status != errSecDuplicateItem else {
return try update(data: data, forKey: key)
}

guard status == errSecSuccess else {
throw KeychainError(status)
}
Expand Down

0 comments on commit 71fb806

Please sign in to comment.