Add continue parameter when logging in
This commit is contained in:
parent
6d30442edd
commit
0884bf3f32
|
@ -12,7 +12,9 @@ defmodule FrenzyWeb.Plug.Authenticate do
|
||||||
case Phoenix.Token.verify(Endpoint, "user token", user_token, max_age: 24 * 60 * 60) do
|
case Phoenix.Token.verify(Endpoint, "user token", user_token, max_age: 24 * 60 * 60) do
|
||||||
{:error, _reason} ->
|
{:error, _reason} ->
|
||||||
conn
|
conn
|
||||||
|> Phoenix.Controller.redirect(to: Routes.login_path(Endpoint, :login))
|
|> Phoenix.Controller.redirect(
|
||||||
|
to: Routes.login_path(Endpoint, :login, continue: Phoenix.Controller.current_path(conn))
|
||||||
|
)
|
||||||
|> halt()
|
|> halt()
|
||||||
|
|
||||||
{:ok, user_id} ->
|
{:ok, user_id} ->
|
||||||
|
|
Loading…
Reference in New Issue