From 308fd495d7e33d42adeb6d56784c5857e77f2bff Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Sun, 21 Apr 2024 11:53:47 -0300 Subject: [PATCH] fix: let you reuse already started client --- lib/supabase/go_true.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/supabase/go_true.ex b/lib/supabase/go_true.ex index 1b39766..621ea45 100644 --- a/lib/supabase/go_true.ex +++ b/lib/supabase/go_true.ex @@ -258,6 +258,11 @@ defmodule Supabase.GoTrue do opts = [name: unquote(client), client_info: config] Supabase.Client.start_link(opts) end + |> then(fn + {:ok, pid} -> {:ok, pid} + {:error, {:already_started, pid}} -> {:ok, pid} + err -> err + end) end unquote(gotrue_functions)