Skip to content

Commit

Permalink
fix: use not authenticated path when ensure authenticated fails
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed Apr 22, 2024
1 parent 2812f93 commit d3222b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/supabase/go_true/live_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ defmodule Supabase.GoTrue.LiveView do

@client Application.compile_env!(:supabase_gotrue, :authentication_client)
@signed_in_path Application.compile_env(:supabase_gotrue, :signed_in_path)
@not_authenticated_path Application.compile_env(:supabase_gotrue, :not_authenticated_path, "/")

# just to ensure config:
Application.compile_env!(:supabase_gotrue, :endpoint)
Expand Down Expand Up @@ -98,7 +99,7 @@ defmodule Supabase.GoTrue.LiveView do
if socket.assigns.current_user do
{:cont, socket}
else
{:halt, Phoenix.LiveView.redirect(socket, to: @signed_in_path)}
{:halt, Phoenix.LiveView.redirect(socket, to: @not_authenticated_path)}
end
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule SupabaseAuth.MixProject do
use Mix.Project

@version "0.3.2"
@version "0.3.3"
@source_url "https://github.com/zoedsoupe/gotrue-ex"

def project do
Expand Down

0 comments on commit d3222b0

Please sign in to comment.