Hi, I feel like I'm going mad with the name of the...
# help
f
Hi, I feel like I'm going mad with the name of the cookie sent to the server, which is being used by the call supabase.auth.setAuth(token) In GetServerSideProps (Next JS) I had the following code working to get the correct user and access RLS tables from the server: "` let token = req.cookies['sb:token'] let authorize = supabase.auth.setAuth(token)`" This was working fine until a couple of weeks ago when it stopped and checking the req object I found the cookie name was name now sb-access-token and updated all my GetServerSideProps to reflect this new name. "` let token = req.cookies['sb-access-token'] let authorize = supabase.auth.setAuth(token)`" Now I check in today and find its broken again and I need to change the token name back to sb:token - does anyone know why this changing? Thx
More info for anyone finding this post - when running locally against the SAAS Supabase instance, the cookie name in the req object is returned as sb:token. When the same code against the same instance is deployed to vercel, the cookie name in the req object is being returned as sb-access-token. I got everything working with a new env variable - COOKIE NAME- but still would love to know what’s going on - can’t find anything in the docs about this.
s
Hi @User sorry for not getting back to you sooner on this, we are making some changes to the way we manage cookies and didn't realise this would have caused a breaking change to user's codebases. We will get the docker development environment to use the same cookie name soon too. Again we are really sorry about this breaking change and will get it documented somewhere soon.
f
Thanks for the confirmation!
Sorry to be back again, but this is getting worse. At some point in the last 2 days the cookie response name for my staging deployment on Vercel changed to sb:token again, breaking the getserverside props randomly. But at the same time, the prod release on vercel os still returning sb-access-token. This is way too erratic - given this key is fundamental to accessing RLS tables, can it have a single, consistent name?
s
@User can you send an email over to support@supabase.io with the details of this issue so we can try and get to the bottom of it please.
f
Just come that. Cheers
Just done that
s
Ok thanks
3 Views