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

Fix(authProvider): It is no longer possible to access a page using direct URL if user is logged out #65

Closed jonathan-marmelab closed 3 months ago

jonathan-marmelab commented 3 months ago

Problem

It was possible to access restricted pages via URL if user was logged out

Solution

Handle AuthSessionMissingError from supabase in supabaseAuthProvider.checkError

How To Test

  1. Run the local demo
  2. Make sure you are not logged in (sign out if necessary)
  3. Browse to http://localhost:8001/contacts

BEFORE: user would see the CRM layout, with an empty ContactList page (and not be redirected to the login page) AFTER: user is automatically redirected to the login page