Remix Databases and Auth

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 34

  • @WillKlein
    @WillKlein 8 หลายเดือนก่อน +1

    Being new to Remix AND Supabase, I've been tripping over a lot of little things getting started with all of this put together.
    Watching this video, I can tell it's really thoughtfully crafted to cover all those little things! Thank you, this is really well done.

  • @yarapolana
    @yarapolana ปีที่แล้ว +9

    I was just searching for remix supabase auth!!! glad to see this video made by Supabase itself🎉

    • @JonMeyers
      @JonMeyers ปีที่แล้ว +1

      Awesome! Glad you found it! 🙌

  • @petethorne5094
    @petethorne5094 ปีที่แล้ว +2

    I came to TH-cam just on the off chance that something like this existed but without any hope that it would! And here it is!

  • @SystemBot
    @SystemBot ปีที่แล้ว +1

    so 6:00 you created a supabase client in dashboard.tsx and then another client in root.tsx 8:28 ?

  • @AndersonSousa33
    @AndersonSousa33 ปีที่แล้ว +5

    You guys have made it SUPA easy. :D

    • @JonMeyers
      @JonMeyers ปีที่แล้ว +2

      That was the goal! ⚽

  • @DarlantenCaten
    @DarlantenCaten หลายเดือนก่อน +2

    Can we get a new video using the ssr package?

    • @brianwalsh7040
      @brianwalsh7040 หลายเดือนก่อน +2

      please! omg Im struggling so hard

  • @davidentzat5671
    @davidentzat5671 ปีที่แล้ว +3

    Very useful and clear video!!! thanks

    • @JonMeyers
      @JonMeyers ปีที่แล้ว +1

      Glad you enjoyed it! 🙌

  • @diurivj
    @diurivj ปีที่แล้ว +5

    I just completed the egghead course and finished this video too and, isn't better to just use auth in the server with the server client and actions instead of syncing the client and the server?

    • @roniaxelrad9493
      @roniaxelrad9493 ปีที่แล้ว +2

      I'm thinking the same thing! and it's more than better, it's required. you must validate the data. But then, the client will not be synched, since .onauthstatechanged() will not trigger the events (since you do that in the server and not the client), but now, how do you synch the client then ??

    • @diurivj
      @diurivj ปีที่แล้ว +4

      If you follow the good old remix pattern, you won’t need to revalidate the client because you'd fetch the data from a route loader and if you change something you would mutate the data with an action, and as you know after every action the loader is called back again. So no need to sync the client

    • @roniaxelrad9493
      @roniaxelrad9493 ปีที่แล้ว +3

      @@diurivj yes, that's true. there's a GET request after every action trigger.. yeah then, I don't see a reason why not doing auth on the server..

    • @jimshtepa5423
      @jimshtepa5423 ปีที่แล้ว

      Then you will have to send session manually along with the response, right?

    • @ruaidhrilumsden
      @ruaidhrilumsden ปีที่แล้ว

      Sorry coming late to this. Well spotted and I started to reason the same way but then aren't the supabase auth methods client only functions? How would you go about calling them from an action?

  • @eleah2665
    @eleah2665 ปีที่แล้ว

    At 11:30 I see signing in and out changes in cookies, not local storage.

  • @jimshtepa5423
    @jimshtepa5423 ปีที่แล้ว +2

    when you created new supabase client at the root file, have you imported that client to the dashboard file? or does dashboard file still maintains its separate client as you should in the beginning? this part was not obvious in the video

  • @IkraamDev
    @IkraamDev ปีที่แล้ว

    lol nice one getting the database dot new domain!

  • @AryanK1511
    @AryanK1511 2 หลายเดือนก่อน

    Great guide

  • @AjinkyaBorade
    @AjinkyaBorade 5 หลายเดือนก่อน

    How to use supabase with prisma, in currently using sqlite in remix app

  • @brianwalsh7040
    @brianwalsh7040 11 หลายเดือนก่อน +1

    Why isn’t auth handled via an action?

  • @abrahamanakagung4279
    @abrahamanakagung4279 10 หลายเดือนก่อน

    cmiiw: those buttons live in client, while /dashboard that render the data live inside server.
    one more thing: how to handle error? I think this is important.

  • @jimshtepa5423
    @jimshtepa5423 ปีที่แล้ว

    if anyone is getting rerendering because of useeffect, removing revalidator from dependency array solves the issue

    • @bickelmeister
      @bickelmeister ปีที่แล้ว

      Thanks for that comment. Do you have further explanation?

    • @eleah2665
      @eleah2665 ปีที่แล้ว

      Yes - I'm seeing the exact same thing. Thanks.

    • @ruaidhrilumsden
      @ruaidhrilumsden ปีที่แล้ว

      Yeah I was getting non-stop rerenders, however I still get a another 4 fetch calls, two of which are cancelled, after moving then coming back to the window from another tab - really weird.

  • @Backtrack51
    @Backtrack51 ปีที่แล้ว

    okay done subscribe, hopefully my code will work

  • @aron6764
    @aron6764 11 หลายเดือนก่อน +2

    In current version of the Remix, I got infinite loop of re-render. I fixed used this way, might help someone!
    const { ENV, user } = useLoaderData();
    const navigation = useNavigation();
    const revalidator = useRevalidator();
    const [supabase] = useState(() =>
    createBrowserClient(ENV.SUPABASE_URL!, ENV.SUPABASE_ANON_KEY!)
    );
    useEffect(() => {
    const {
    data: { subscription },
    } = supabase.auth.onAuthStateChange((_event, session) => {
    if (session?.user.id !== user?.id) {
    revalidator.revalidate();
    }
    });
    return () => {
    subscription.unsubscribe();
    };
    }, [supabase, revalidator, user]);

    • @brianwalsh7040
      @brianwalsh7040 11 หลายเดือนก่อน

      Are you able to get this auth flow to work with email/password sign up instead of oath?