Skip to content

Commit

Permalink
log when password invalid, #67
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonLab committed May 22, 2020
1 parent 3ce3a24 commit 64debf6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/auth_web/controllers/auth_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ defmodule AuthWeb.AuthController do
ip_address: ip_address,
email: nil
}

Auth.LoginLog.create_login_log(login_log)

# email invalid, re-render the login/register form:
Expand Down Expand Up @@ -372,6 +373,20 @@ defmodule AuthWeb.AuthController do
That password is incorrect.
"""

# log password incorrect

user_agent = get_user_agent(conn)
ip_address = get_ip_address(conn)

login_log = %{
user_agent_id: user_agent.id,
person_id: person.id,
ip_address: ip_address,
email: person.email
}

Auth.LoginLog.create_login_log(login_log)

render_password_form(conn, email, msg, p["state"], "password_prompt")
end
end
Expand Down

0 comments on commit 64debf6

Please sign in to comment.