You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However the issue is that I can't update this header after the client is created so if the orgContactId changes, I need to create a completely new client
I do that by taking the "singleton" in to my own hands and when I detect an ID change, I create a new client that has the new header
The downside to this is that I get warnings in my console stating there are now multiple clients created and that I may deal with unintended behavior.
I think I'm running in to that unintended behavior now. I use NextJS and just tried running my dev server with next dev --turbo. For some reason, my supabase client will only ever use my first instantiated version of the client (which doesnt contain a org-contact-id) even if a few seconds later a new auth client is instantiated with an org-contact-id. It simply just isn't used for any of my requests (the header is empty since it was the first client instantiated it seems...)
I would love to be able to just simply update the headers in the client after it's created...if possible.
Hope you see the use case for it, let me know if you have any other questions :)
Bug report
Describe the bug
I need to send headers with my client requests. To do that I have configured the following:
However the issue is that I can't update this header after the client is created so if the
orgContactId
changes, I need to create a completely new clientI do that by taking the "singleton" in to my own hands and when I detect an ID change, I create a new client that has the new header
The downside to this is that I get warnings in my console stating there are now multiple clients created and that I may deal with unintended behavior.
I think I'm running in to that unintended behavior now. I use NextJS and just tried running my dev server with
next dev --turbo
. For some reason, my supabase client will only ever use my first instantiated version of the client (which doesnt contain a org-contact-id) even if a few seconds later a new auth client is instantiated with an org-contact-id. It simply just isn't used for any of my requests (the header is empty since it was the first client instantiated it seems...)I would love to be able to just simply update the headers in the client after it's created...if possible.
Hope you see the use case for it, let me know if you have any other questions :)
Meant to send this months ago but the recommendation came from this auth/ssr discussion: https://github.com/orgs/supabase/discussions/27037
System information
The text was updated successfully, but these errors were encountered: