diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index 3520269875..92a94c8470 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -101,11 +101,7 @@ async fn register(data: JsonUpcase, conn: DbConn) -> EmptyResult { let mut user = match User::find_by_mail(&email, &conn).await { Some(user) => { if !user.password_hash.is_empty() { - if CONFIG.is_signup_allowed(&email) { - err!("User already exists") - } else { - err!("Registration not allowed or user already exists") - } + err!("Registration not allowed or user already exists") } if let Some(token) = data.Token { @@ -124,7 +120,7 @@ async fn register(data: JsonUpcase, conn: DbConn) -> EmptyResult { } else if EmergencyAccess::find_invited_by_grantee_email(&email, &conn).await.is_some() { user } else if CONFIG.is_signup_allowed(&email) { - err!("Account with this email already exists") + user } else { err!("Registration not allowed or user already exists") }