mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
ensure flash is fetched
This commit is contained in:
parent
b1828ff68a
commit
1fbe3bd555
2 changed files with 4 additions and 2 deletions
|
@ -7,8 +7,9 @@ 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()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,8 +7,9 @@ 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()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue