1
Why do I need to do manual refresh of the realtime token?
Source: supabase/supabase#37002 · opened by @jbojcic1
I am using custom auth with Supabase by using the accessToken method (see accessToken under options [here]( The code looks something like this:
My getJwtWithRefresh makes sure to refresh the token before it expires. In logs I see accessToken method called being logged every 5 or so seconds and everything works fine.
However the issue is with supabase realtime. When the token expires and is refreshed, the realtime doesn't seem to be updated and it seems that I need to manually call supabase.realtime.setAuth('fresh-token') after each refresh as described [here]( Why is that so? Couldn't Supabase handle that internally by detecting when accessToken method returns a new token and then call realtime.setAuth internally?
My getJwtWithRefresh makes sure to refresh the token before it expires. In logs I see accessToken method called being logged every 5 or so seconds and everything works fine.
However the issue is with supabase realtime. When the token expires and is refreshed, the realtime doesn't seem to be updated and it seems that I need to manually call supabase.realtime.setAuth('fresh-token') after each refresh as described [here]( Why is that so? Couldn't Supabase handle that internally by detecting when accessToken method returns a new token and then call realtime.setAuth internally?
No pledges yet. Be the first to back this.
Comments
Similar requests
[Auth] Allow indefinite refresh token reuse
5 votes · 0 comments
Automatically Logout users in cases when persistSession is false and the user closes the browser window
1 vote · 0 comments
Make Changes to the DB through a Realtime extension
2 votes · 0 comments
[Auth] Display user valid sessions and allow to invalidate some or all of them
14 votes · 0 comments
Individual NPM packages for supabase-js modules?
2 votes · 0 comments
No comments yet.