marmelab / ra-supabase

Supabase adapter for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services.
MIT License
156 stars 27 forks source link

Update supabase-js dev to match new auth system #55

Closed Revarh closed 6 months ago

Revarh commented 6 months ago

Hello RA team,

Supabase update their authSystem last week resulting in throwing a 403 error instead of a 401+logout as before. It makes that when we connect, sometimes we get stuck in a limbo between trying to connect and accessing React-Admin.

I addressed that issue to Supabase team and this is their answer:

**This error is returned when we detect that the session_id claim in the access token doesn't exist in the auth.sessions table. It was introduced in this PR (https://github.com/supabase/auth/pull/1538) because we realised that we were returning the wrong error when the session is missing. Before this PR was merged, the sign out API would return a panic and fail silently, returning a 5xx error to the client which can't be handled.

You can fix this by doing either one of these options:**

Manually ignore 403s returned from signOut and just clear the local session stored on the browser.
Upgrade to supabase-js v2.43.1 which contains the changes to ignore 403s returned by the signOut method

This push updates the devDependencies version of both supabase-js and @raphiniert/ra-data-postgrest in supabase-core package.sjon

Kind regards,