sidferreira / aor-firebase-client

Firebase client for Admin on Rest
MIT License
57 stars 29 forks source link

RestClient fetches data before Auth #21

Closed kidphys closed 6 years ago

kidphys commented 7 years ago

When I try to add RestClient to admin like this:

 <Admin restClient={RestClient(trackedResources, firebaseConfig)} authClient={AuthClient}>
      <Resource name="users" list={UserList} edit={UserEdit} icon={UserIcon}/>
 </Admin>

And the resource "users" is guarded by firebase permission rules, and is not loaded. The login page is either hanged if access "/users" directly, or login successfully but then "users" is not loaded.

After debugging, it seems to me that the firebase client is binding to the resource "users" without checking for authentication status, the firebase web-socket frame returns "permission denied" and then hang then.

There might be 2 improvements needed:

sidferreira commented 7 years ago

@kidphys Great input! Any chance you can work on that and help us?

sidferreira commented 6 years ago

@kidphys FIxed on v0.2.0