supabase / auth-helpers

A collection of framework specific Auth utilities for working with Supabase.

Home Page:https://supabase.github.io/auth-helpers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the cookies option doesn't seem to be doing anything

JorensM opened this issue · comments

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Setting the CRUD functions for the cookies option doesn't seem to be doing anything. The functions never get called.

To Reproduce

supabase cookies option

In this code I posted you can see that I've simply added console.logs to the setter/getter/remover. Yet the console never logs any of those messages. I should also note that I'm using a custom storage handler in the auth option. I should also say that I know that the Supabase client uses the auth storage to store cookies. Which then begs the question: why do we have a separate cookie CRUD object if it's not being used? Currently TypeScript says that this property is required, which seems redundant considering that the client is using the storage defined in auth to manage cookies, and considering that the getters/setters never get called anyway. I'd expect at the very least for the cookies property not to be required.

Expected behavior

I'd expect for either:

a) the cookies functions to be called
b) the cookies property to be optional

Screenshots

See screenshot of my Supabase config above.

System information

  • OS: Windows 10
  • Browser: Chrome
  • Version of supabase-js: 2.39.3
  • Version of supabase/ssr: 0.0.10
  • Version of Node.js: 20.8.0

Additional context

I'm moving away from supabase/ssr because I found out that it only uses cookies for storing the session and doesn't offer any alternatives, which won't work for me because I'm writing an app with React Native, which doesn't support cookies. But just thought I'd share this small bug with you.

I'm pretty confident get, set, and remove should be synchronous instead of async. If you remove async do you still get the same results?

This is expected. createServer/BrowserClient implement their own storage option. So if you already set your own, your custom option (AsyncStorage) wins.