Created
March 28, 2022 08:34
-
-
Save wttj-tech/a2e8ea4dcfa9e0ed999dd14e11a253f8 to your computer and use it in GitHub Desktop.
Impartial response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create(conn, %{"user" => %{"email" => email}}) do | |
if user = Accounts.get_user_by_email(email) do | |
Accounts.deliver_user_reset_password_instructions( | |
user, | |
&Routes.user_reset_password_url(conn, :edit, &1) | |
) | |
end | |
# In order to prevent user enumeration attacks, regardless of the outcome, show an impartial success/error message. | |
conn | |
|> put_flash( | |
:info, | |
"If your email is in our system, you will receive instructions to reset your password shortly." | |
) | |
|> redirect(to: "/") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment