mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 00:01:00 +00:00
Fix push issues
This commit is contained in:
parent
2397758456
commit
ad4e699ce1
2 changed files with 10 additions and 1 deletions
|
@ -19,7 +19,13 @@ extension LiveKeychain: Keychain {
|
||||||
|
|
||||||
query[kSecValueData as String] = data
|
query[kSecValueData as String] = data
|
||||||
|
|
||||||
let status = SecItemAdd(query as CFDictionary, nil)
|
var status = SecItemAdd(query as CFDictionary, nil)
|
||||||
|
|
||||||
|
if status == errSecDuplicateItem {
|
||||||
|
status = SecItemUpdate(
|
||||||
|
genericPasswordQueryDictionary(account: account, service: service) as CFDictionary,
|
||||||
|
[kSecValueData as String: data] as CFDictionary)
|
||||||
|
}
|
||||||
|
|
||||||
if status != errSecSuccess {
|
if status != errSecSuccess {
|
||||||
throw NSError(status: status)
|
throw NSError(status: status)
|
||||||
|
@ -54,6 +60,8 @@ extension LiveKeychain: Keychain {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func generateKeyAndReturnPublicKey(applicationTag: String, attributes: [String: Any]) throws -> Data {
|
public static func generateKeyAndReturnPublicKey(applicationTag: String, attributes: [String: Any]) throws -> Data {
|
||||||
|
try? deleteKey(applicationTag: applicationTag)
|
||||||
|
|
||||||
var attributes = attributes
|
var attributes = attributes
|
||||||
var error: Unmanaged<CFError>?
|
var error: Unmanaged<CFError>?
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ public extension AllIdentitiesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.map(Publishers.MergeMany.init)
|
.map(Publishers.MergeMany.init)
|
||||||
|
.flatMap { $0 }
|
||||||
.ignoreOutput()
|
.ignoreOutput()
|
||||||
.eraseToAnyPublisher()
|
.eraseToAnyPublisher()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue