Allow email changes for existing accounts even when signups are disabled

This commit is contained in:
Jeremy Lin committed 2020-05-24 14:38:19 -07:00
1 parent c5d7e3f2bc
commit a314933557
3 files changed
+9 -8

No files matched your search

+2 -2
View File
@@ -379,8 +379,8 @@ fn post_email_token(data: JsonUpcase<EmailTokenData>, headers: Headers, conn: Db
err!("Email already in use");
}
if !CONFIG.is_signup_allowed(&data.NewEmail) {
err!("Email cannot be changed to this address");
if !CONFIG.is_email_domain_allowed(&data.NewEmail) {
err!("Email domain not allowed");
}
let token = crypto::generate_token(6)?;