Skip to content

Commit 1e0f7e6

Browse files
committed
fix: assign return_to parameter in sign-in live view for improved redirection handling
1 parent dee2b07 commit 1e0f7e6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/algora_web/live/sign_in_live.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ defmodule AlgoraWeb.SignInLive do
236236

237237
{:ok,
238238
socket
239+
|> assign(:return_to, params["return_to"])
239240
|> assign(:authorize_url, authorize_url)
240241
|> assign(:secret_code, nil)
241242
|> assign(:user_type, "company")
@@ -254,12 +255,7 @@ defmodule AlgoraWeb.SignInLive do
254255

255256
socket = if params["verify"] == "1", do: LocalStore.subscribe(socket), else: socket
256257

257-
socket =
258-
socket
259-
|> assign(:return_to, params["return_to"])
260-
|> assign(:mode, socket.assigns.live_action)
261-
262-
{:noreply, socket}
258+
{:noreply, assign(socket, :mode, socket.assigns.live_action)}
263259
end
264260

265261
@impl true

0 commit comments

Comments
 (0)