hack: trim whitespace on stored keys

Noticed a crash when I accidently logged in with whitespace in the keys.
We should probably not save keys with whitespace in them, this is just a
hack for now.
This commit is contained in:
William Casarin
2022-12-25 15:16:14 -08:00
parent 8b7b77c2e8
commit e7b2cc9df1

View File

@@ -133,7 +133,8 @@ func get_saved_pubkey() -> String? {
}
func get_saved_privkey() -> String? {
try? Vault.getPrivateKey(keychainConfiguration: DamusKeychainConfiguration())
let mkey = try? Vault.getPrivateKey(keychainConfiguration: DamusKeychainConfiguration());
return mkey.map { $0.trimmingCharacters(in: .whitespaces) }
}
fileprivate func removePrivateKeyFromUserDefaults() throws {