# "Login by email" switches to incorrect strings when "hide email address" activated

**URL:** <https://meta.discourse.org/t/login-by-email-switches-to-incorrect-strings-when-hide-email-address-activated/143432>\
**Category:** Bug\
**Created:** [5 maart 2020 om 18:07 UTC](https://meta.discourse.org/t/login-by-email-switches-to-incorrect-strings-when-hide-email-address-activated/143432 "2020-03-05T18:07:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)\
**Post date:** [5 maart 2020 om 18:07 UTC](https://meta.discourse.org/t/login-by-email-switches-to-incorrect-strings-when-hide-email-address-activated/143432/1 "2020-03-05T18:07:36Z")

</div>

# Reproduce:

1. Enable the site setting `hide email address taken`, which is normally disabled, and described as _“Don’t inform users that an account exists with a given email address during signup and from the forgot password form.”_

2. From a new browser session, attempt to log in 📧 with email, and supply an invalid username, such as **codinghorror**.

# Expected behavior

The error message text from one of the following strings apppears, not divulging the existince or non-existence of an account.

**js.email\_login.complete\_email:**

> If an account matches **[codinghorror@example.com](mailto:codinghorror@example.com)**, you should receive an email with a login link shortly.

**js.email\_login.complete\_username:**

> If an account matches **codinghorror** , you should receive an email with a login link shortly.

# Actual behavior

The error message text incorrectly indicates that there was a positive match, even when there was no match.

**js.email\_login.complete\_email\_found:**

> We found an account that matches **[codinghorror@example.com](mailto:codinghorror@example.com)**, you should receive an email with a login link shortly.

**js.email\_login.complete\_username\_found:**

> We found an account that matches the username **codinghorror** , you should receive an email with a login link shortly.

# Commentary

Although this works correctly for the “reset password” process, it seems the same logic should hold through with the login by email workflow.

---

_[View the full topic](https://meta.discourse.org/t/login-by-email-switches-to-incorrect-strings-when-hide-email-address-activated/143432)._
