Remove password inside try/catch
This commit is contained in:
parent
ecb2c951a8
commit
4a5bc92fcb
|
@ -103,6 +103,7 @@ public class Keychain {
|
||||||
guard password != currentPassword else {
|
guard password != currentPassword else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
removePassword(for: username)
|
||||||
} catch let e as KeychainError {
|
} catch let e as KeychainError {
|
||||||
|
|
||||||
// rethrow cancelation
|
// rethrow cancelation
|
||||||
|
@ -113,8 +114,6 @@ public class Keychain {
|
||||||
// otherwise, no pre-existing password
|
// otherwise, no pre-existing password
|
||||||
}
|
}
|
||||||
|
|
||||||
removePassword(for: username)
|
|
||||||
|
|
||||||
var query = [String: Any]()
|
var query = [String: Any]()
|
||||||
setScope(query: &query)
|
setScope(query: &query)
|
||||||
query[kSecClass as String] = kSecClassGenericPassword
|
query[kSecClass as String] = kSecClassGenericPassword
|
||||||
|
|
Loading…
Reference in New Issue