Skip to content

Commit dee2b07

Browse files
committed
fix: streamline redirection in tip controller
1 parent b47a7e8 commit dee2b07

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/algora_web/controllers/tip_controller.ex

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ defmodule AlgoraWeb.TipController do
3636
else
3737
# TODO: just use a plug
3838
{:error, :unauthorized} ->
39-
conn
40-
|> put_session(:user_return_to, conn.request_path <> "?" <> conn.query_string)
41-
|> put_flash(:error, "You must be logged in to tip")
42-
|> redirect(to: ~p"/auth/login")
39+
redirect(conn, to: ~p"/auth/login?#{%{return_to: conn.request_path <> "?" <> conn.query_string}}")
4340

4441
{:error, reason} ->
4542
conn

0 commit comments

Comments
 (0)