aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-11 18:21:55 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-11 18:21:55 -0400
commit504dd55666a13950657308a3a4be4e5f46e7abad (patch)
tree8eb5d8e183337c41420a26d77ea4531d3fa68504 /src/db.rs
parent0d2cb917ba9373e3a80581c73a3afb2b905be0b2 (diff)
downloadrbw-504dd55666a13950657308a3a4be4e5f46e7abad.tar.gz
rbw-504dd55666a13950657308a3a4be4e5f46e7abad.zip
only actually login or unlock if it's required
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/db.rs b/src/db.rs
index 9d76d7a..7e94d73 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -83,6 +83,13 @@ impl Db {
Ok(())
}
+ pub fn needs_login(&self) -> bool {
+ self.access_token.is_none()
+ || self.refresh_token.is_none()
+ || self.iterations.is_none()
+ || self.protected_key.is_none()
+ }
+
fn filename(email: &str) -> std::path::PathBuf {
crate::dirs::cache_dir().join(format!("{}.json", email))
}