This commit is contained in:
parent
d40bc0bb82
commit
d10fcc3da1
7 changed files with 68 additions and 46 deletions
|
|
@ -34,8 +34,10 @@ defmodule MvWeb.LiveUserAuth do
|
|||
case socket.assigns do
|
||||
%{current_user: %{} = user} ->
|
||||
{:cont, assign(socket, :current_user, user)}
|
||||
|
||||
_ ->
|
||||
{:halt, Phoenix.LiveView.redirect(socket, to: ~p"/sign-in")}
|
||||
socket = Phoenix.LiveView.redirect(socket, to: ~p"/sign-in")
|
||||
{:halt, socket}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue