diff --git a/test/plausible_web/controllers/auth_controller_test.exs b/test/plausible_web/controllers/auth_controller_test.exs index fa066d2ba953..9225c974171b 100644 --- a/test/plausible_web/controllers/auth_controller_test.exs +++ b/test/plausible_web/controllers/auth_controller_test.exs @@ -879,7 +879,7 @@ defmodule PlausibleWeb.AuthControllerTest do assert conn.resp_cookies["remember_2fa"].max_age == 0 end - test "redirects to login_dest when set", %{conn: conn} do + test "redirects to return_to when set", %{conn: conn} do user = insert(:user) # enable 2FA diff --git a/test/plausible_web/plugs/user_session_touch_test.exs b/test/plausible_web/plugs/user_session_touch_test.exs index b28ab375528c..8a2a3bf6384d 100644 --- a/test/plausible_web/plugs/user_session_touch_test.exs +++ b/test/plausible_web/plugs/user_session_touch_test.exs @@ -29,11 +29,9 @@ defmodule PlausibleWeb.Plugs.UserSessionTouchTest do conn = build_conn() |> init_session() - |> put_session(:login_dest, "/") |> UserSessionTouch.call([]) refute conn.halted - assert get_session(conn, :login_dest) == "/" refute get_session(conn, :user_token) end end diff --git a/test/plausible_web/user_auth_test.exs b/test/plausible_web/user_auth_test.exs index 5d7f10b05825..ddbf3cf60032 100644 --- a/test/plausible_web/user_auth_test.exs +++ b/test/plausible_web/user_auth_test.exs @@ -30,17 +30,6 @@ defmodule PlausibleWeb.UserAuthTest do assert conn.private[:plug_session_info] == :renew assert conn.resp_cookies["logged_in"].max_age > 0 assert get_session(conn, :user_token) == session.token - assert get_session(conn, :login_dest) == nil - end - - test "redirects to `login_dest` if present", %{conn: conn, user: user} do - conn = - conn - |> init_session() - |> put_session("login_dest", "/next") - |> UserAuth.log_in_user(user) - - assert redirected_to(conn, 302) == "/next" end test "redirects to `redirect_path` if present", %{conn: conn, user: user} do @@ -51,16 +40,6 @@ defmodule PlausibleWeb.UserAuthTest do assert redirected_to(conn, 302) == "/next" end - - test "redirect_path` has precednce over `login_dest`", %{conn: conn, user: user} do - conn = - conn - |> init_session() - |> put_session("login_dest", "/ignored") - |> UserAuth.log_in_user(user, "/next") - - assert redirected_to(conn, 302) == "/next" - end end describe "log_out_user/1" do @@ -76,7 +55,6 @@ defmodule PlausibleWeb.UserAuthTest do conn = conn |> init_session() - |> put_session("login_dest", "/ignored") |> UserAuth.log_out_user() # the other session remains intact @@ -84,7 +62,6 @@ defmodule PlausibleWeb.UserAuthTest do assert another_session.token == another_session_token assert conn.private[:plug_session_info] == :renew assert conn.resp_cookies["logged_in"].max_age == 0 - assert get_session(conn, :login_dest) == nil end end