Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-09 17:52:26 +01:00
parent 8ac705d8c2
commit 92d2045735
97 changed files with 18243 additions and 1544 deletions

View File

@@ -8,9 +8,12 @@ defmodule EventosWeb.SessionController do
# Attempt to authenticate the user
with {:ok, token, _claims} <- Accounts.authenticate(%{user: user, password: password}) do
# Render the token
render conn, "token.json", token: token
user = Eventos.Repo.preload user, :account
render conn, "token.json", %{token: token, user: user}
end
send_resp(conn, 400, "Bad login")
end
send_resp(conn, 400, "No such user")
end
def sign_out(conn, _params) do