ensure flash is fetched

This commit is contained in:
byte[] 2019-12-14 22:25:11 -05:00
parent b1828ff68a
commit 1fbe3bd555
2 changed files with 4 additions and 2 deletions

View file

@ -7,6 +7,7 @@ defmodule PhilomenaWeb.NotAuthorizedPlug do
def call(conn), do: call(conn, nil)
def call(conn, _opts) do
conn
|> Controller.fetch_flash()
|> Controller.put_flash(:error, "You can't access that page.")
|> Controller.redirect(external: conn.assigns.referrer)
|> Conn.halt()

View file

@ -7,6 +7,7 @@ defmodule PhilomenaWeb.NotFoundPlug do
def call(conn), do: call(conn, nil)
def call(conn, _opts) do
conn
|> Controller.fetch_flash()
|> Controller.put_flash(:error, "Couldn't find what you were looking for!")
|> Controller.redirect(external: conn.assigns.referrer)
|> Conn.halt()