commit 632d55265b6931c3091a9dc61c594c005d264f71
parent ff7b4a3d38f07eb5687ae9beaa044777f07dadba
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Tue, 28 Jan 2020 20:52:16 +0100
Merge pull request #824 from tomuta/fix_change_email
Fix change email when no whitelist is configured
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> {