From d3222b03472625ee0df18a19b1a28bbdc3b391db Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Mon, 22 Apr 2024 12:41:12 -0300 Subject: [PATCH] fix: use not authenticated path when ensure authenticated fails --- lib/supabase/go_true/live_view.ex | 3 ++- mix.exs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/supabase/go_true/live_view.ex b/lib/supabase/go_true/live_view.ex index 092c9cc..e9ad74e 100644 --- a/lib/supabase/go_true/live_view.ex +++ b/lib/supabase/go_true/live_view.ex @@ -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) @@ -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 diff --git a/mix.exs b/mix.exs index 44e3b98..da429a2 100644 --- a/mix.exs +++ b/mix.exs @@ -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