logout: clear keypair on logout

Fixes: #12
Reported-by: Jeff Thibault (github:jeffthibault)
Changelog-Fixed: Logging out now resets your keypair and actually logs out
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-07-28 12:52:58 -07:00
parent fead2a498f
commit f522fc79df
3 changed files with 13 additions and 3 deletions

View File

@@ -139,12 +139,12 @@ func process_login(_ key: ParsedKey, is_pubkey: Bool) -> Bool {
save_pubkey(pubkey: pk)
case .pub(let pub):
clear_privkey()
clear_saved_privkey()
save_pubkey(pubkey: pub)
case .hex(let hexstr):
if is_pubkey {
clear_privkey()
clear_saved_privkey()
save_pubkey(pubkey: hexstr)
} else {
save_privkey(privkey: hexstr)