Skip to content

Commit

Permalink
Added halt to lib/addict/interactors/session_interactor.ex. This fixe…
Browse files Browse the repository at this point in the history
…s error 'the response was already sent'. Also comeonin clean and update in example_app/mix.lock.
  • Loading branch information
Michael Chavez committed Nov 4, 2015
1 parent e13752c commit 95ea826
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example_app/mix.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%{"comeonin": {:hex, :comeonin, "1.1.2"},
%{"comeonin": {:hex, :comeonin, "1.3.1"},
"cowboy": {:hex, :cowboy, "1.0.3"},
"cowlib": {:hex, :cowlib, "1.0.1"},
"decimal": {:hex, :decimal, "1.1.0"},
"ecto": {:hex, :ecto, "1.0.6"},
"fs": {:hex, :fs, "0.9.2"},
"mailgun": {:hex, :mailgun, "0.0.2"},
"phoenix": {:hex, :phoenix, "0.16.1"},
"phoenix": {:hex, :phoenix, "0.17.1"},
"phoenix_ecto": {:hex, :phoenix_ecto, "1.2.0"},
"phoenix_html": {:hex, :phoenix_html, "2.2.0"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "0.6.0"},
Expand Down
4 changes: 4 additions & 0 deletions lib/addict/interactors/session_interactor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ defmodule Addict.SessionInteractor do
conn = fetch_session(conn)
|> put_status(201)
|> create_session(user)
|> halt

{conn, %{message: "user created", user: sanitize_user(user)}}
end
Expand All @@ -19,6 +20,7 @@ defmodule Addict.SessionInteractor do
conn = fetch_session(conn)
|> put_status(200)
|> create_session(user)
|> halt
{conn, %{message: "logged in", user: sanitize_user(user)}}
end

Expand All @@ -39,6 +41,7 @@ defmodule Addict.SessionInteractor do
def password_recover({:ok, _}, conn) do
conn = conn
|> put_status(200)
|> halt
{conn, %{message: "email sent"}}
end

Expand All @@ -51,6 +54,7 @@ defmodule Addict.SessionInteractor do
def password_reset({:ok, _}, conn) do
conn = conn
|> put_status(200)
|> halt
{conn, %{message: "password reset"}}
end

Expand Down

0 comments on commit 95ea826

Please sign in to comment.