commit e277f7d1c12dc90d3a4ec63b7c6b88613fa56f5c
parent d212dfe735e59128667a4c579e52ce7e86b53a94
Author: tomuta <tomut@yahoo.com>
Date: Sun, 26 Jan 2020 13:34:56 -0700
Fix change email when no whitelist is configured
Fixes issue #792
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/config.rs b/src/config.rs
@@ -510,7 +510,12 @@ impl Config {
warn!("Failed to parse email address '{}'", email);
return false;
}
- self.signups_domains_whitelist().split(',').any(|d| d == e[0])
+
+ // Allow signups if the whitelist is empty/not configured
+ // (it doesn't contain any domains), or if it matches at least
+ // one domain.
+ let whitelist_str = self.signups_domains_whitelist();
+ whitelist_str.is_empty() || whitelist_str.split(',').filter(|s| !s.is_empty()).any(|d| d == e[0])
}
pub fn delete_user_config(&self) -> Result<(), Error> {