mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-22 19:57:14 +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,6 +7,7 @@ defmodule PhilomenaWeb.NotAuthorizedPlug do
|
||||||
def call(conn), do: call(conn, nil)
|
def call(conn), do: call(conn, nil)
|
||||||
def call(conn, _opts) do
|
def call(conn, _opts) do
|
||||||
conn
|
conn
|
||||||
|
|> Controller.fetch_flash()
|
||||||
|> Controller.put_flash(:error, "You can't access that page.")
|
|> Controller.put_flash(:error, "You can't access that page.")
|
||||||
|> Controller.redirect(external: conn.assigns.referrer)
|
|> Controller.redirect(external: conn.assigns.referrer)
|
||||||
|> Conn.halt()
|
|> Conn.halt()
|
||||||
|
|
|
@ -7,6 +7,7 @@ defmodule PhilomenaWeb.NotFoundPlug do
|
||||||
def call(conn), do: call(conn, nil)
|
def call(conn), do: call(conn, nil)
|
||||||
def call(conn, _opts) do
|
def call(conn, _opts) do
|
||||||
conn
|
conn
|
||||||
|
|> Controller.fetch_flash()
|
||||||
|> Controller.put_flash(:error, "Couldn't find what you were looking for!")
|
|> Controller.put_flash(:error, "Couldn't find what you were looking for!")
|
||||||
|> Controller.redirect(external: conn.assigns.referrer)
|
|> Controller.redirect(external: conn.assigns.referrer)
|
||||||
|> Conn.halt()
|
|> Conn.halt()
|
||||||
|
|
Loading…
Add table
Reference in a new issue