From 95ea8267f0eda5b2f9058a8f600046e5348ac38c Mon Sep 17 00:00:00 2001 From: Michael Chavez Date: Tue, 3 Nov 2015 21:28:03 -0800 Subject: [PATCH] Added halt to lib/addict/interactors/session_interactor.ex. This fixes error 'the response was already sent'. Also comeonin clean and update in example_app/mix.lock. --- example_app/mix.lock | 4 ++-- lib/addict/interactors/session_interactor.ex | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/example_app/mix.lock b/example_app/mix.lock index 26b6545..efc574d 100644 --- a/example_app/mix.lock +++ b/example_app/mix.lock @@ -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"}, diff --git a/lib/addict/interactors/session_interactor.ex b/lib/addict/interactors/session_interactor.ex index 3525f23..2375158 100644 --- a/lib/addict/interactors/session_interactor.ex +++ b/lib/addict/interactors/session_interactor.ex @@ -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 @@ -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 @@ -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 @@ -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