diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 39044c0..6c6c761 100644 --- a/src/config.rs +++ b/src/config.rs @@ -70,6 +70,14 @@ impl Config { Ok(()) } + pub fn validate() -> Result<()> { + let config = Self::load()?; + if config.email.is_none() { + return Err(Error::ConfigMissingEmail); + } + Ok(()) + } + pub fn base_url(&self) -> String { self.base_url.clone().map_or_else( || "https://api.bitwarden.com".to_string(), |