What exactly should you do when your JWT has expir...
# help
y
What exactly should you do when your JWT has expired? How do you go about fetching a new one? EDIT: There's an undocumented method called refreshAccessToken, but how would I go about detecting that my current JWT has expired, so i can refresh my JWT silently?
m
If you decode it, you can see when it is going to expire
y
how would i go about actually refreshing the token though? aka how do I know that I should refresh my token? ex: the JWT would expire in 15 mins, how would I refresh it before then
isn't this the kinda thing the library should handle tho?
m
If you use supabase js, it handles by itself
You dont need to refresh it
y
but it would error out randomly that my jwt is expired every now and then
I'm currently using supabase-js v1.21.0
m
Hmm, Im not sure. I never received an error for the expired token using supabase-js
Maybe someone else knows
y
do you also set an auth cookie? could that have something to do?
m
I dont. I use it directly from frontend