Add continue parameter when logging in

This commit is contained in:
Shadowfacts 2020-07-18 10:16:25 -04:00
parent 6d30442edd
commit 0884bf3f32
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 1 deletions

View File

@ -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} ->