mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
you have to halt the plug pipeline explicitly
This commit is contained in:
parent
6d673a4fed
commit
4b86e783ef
10 changed files with 10 additions and 1 deletions
|
@ -23,6 +23,7 @@ defmodule PhilomenaWeb.Api.Json.Image.FeaturedController do
|
|||
conn
|
||||
|> put_status(:not_found)
|
||||
|> text("")
|
||||
|> halt()
|
||||
|
||||
_ ->
|
||||
interactions = Interactions.user_interactions([featured_image], user)
|
||||
|
|
|
@ -47,6 +47,7 @@ defmodule PhilomenaWeb.Filter.HideController do
|
|||
conn
|
||||
|> put_status(:forbidden)
|
||||
|> text("")
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,6 +47,7 @@ defmodule PhilomenaWeb.Filter.SpoilerController do
|
|||
conn
|
||||
|> put_status(:forbidden)
|
||||
|> text("")
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -59,6 +59,7 @@ defmodule PhilomenaWeb.Image.DeleteController do
|
|||
conn
|
||||
|> put_flash(:error, "Cannot change hide reason on a non-hidden image!")
|
||||
|> redirect(to: Routes.image_path(conn, :show, conn.assigns.image))
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ defmodule PhilomenaWeb.Image.FeatureController do
|
|||
conn
|
||||
|> put_flash(:error, "Cannot feature a hidden image.")
|
||||
|> redirect(to: Routes.image_path(conn, :show, conn.assigns.image))
|
||||
|> halt()
|
||||
|
||||
_false ->
|
||||
conn
|
||||
|
|
|
@ -35,6 +35,7 @@ defmodule PhilomenaWeb.Image.FileController do
|
|||
conn
|
||||
|> put_flash(:error, "Cannot replace a hidden image.")
|
||||
|> redirect(to: Routes.image_path(conn, :show, conn.assigns.image))
|
||||
|> halt()
|
||||
|
||||
_false ->
|
||||
conn
|
||||
|
|
|
@ -188,7 +188,7 @@ defmodule PhilomenaWeb.ImageController do
|
|||
"The image you were looking for has been marked a duplicate of the image below"
|
||||
)
|
||||
|> redirect(to: Routes.image_path(conn, :show, image.duplicate_id))
|
||||
|> Plug.Conn.halt()
|
||||
|> halt()
|
||||
|
||||
true ->
|
||||
conn
|
||||
|
|
|
@ -149,6 +149,7 @@ defmodule PhilomenaWeb.Profile.CommissionController do
|
|||
conn
|
||||
|> put_flash(:error, "You must have a verified user link to create a commission listing.")
|
||||
|> redirect(to: Routes.commission_path(conn, :index))
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -153,6 +153,7 @@ defmodule PhilomenaWeb.TagController do
|
|||
"This tag (\"#{conn.assigns.tag.name}\") has been aliased into the tag \"#{tag.name}\"."
|
||||
)
|
||||
|> redirect(to: Routes.tag_path(conn, :show, tag))
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,6 +31,7 @@ defmodule PhilomenaWeb.EnsureUserEnabledPlug do
|
|||
conn
|
||||
|> Plug.delete()
|
||||
|> Controller.redirect(to: Routes.pow_session_path(conn, :new))
|
||||
|> Conn.halt()
|
||||
end
|
||||
|
||||
defp maybe_halt(_any, conn), do: conn
|
||||
|
|
Loading…
Reference in a new issue