Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logged in save user data #145

Open
lalote opened this issue Apr 26, 2020 · 3 comments
Open

logged in save user data #145

lalote opened this issue Apr 26, 2020 · 3 comments

Comments

@lalote
Copy link

lalote commented Apr 26, 2020

Hello, in feathersjs when you logged in, you get the accessToken and user data (at least default configuration) . The accessToken is saved at localStorage, so, there are any posibility of add a authClient.options for save the user data in localStorage too?

@josx
Copy link
Owner

josx commented Apr 27, 2020

Right now We are following the react-admin interface. At least we are putting on localstorage permissions and token.

But if you want to access to all other props in user you can always do a GET to that service.

@nicholasnelson
Copy link
Contributor

nicholasnelson commented Jun 4, 2020

@lalote Can you explain why this functionality should be included in ra-data-feathers, and not implemented elsewhere (e.g. in your application)?

If you need the user data to be saved immediately on login without retrieving it separately as @josx has suggested, I think the correct approach would be to listen for the login or authenticated events from the feathers client directly:

feathersClient.on('login', user => handleUserData(user));

FeathersJS .on(eventname, listener) documentation for reference.

I just don't see that the requested functionality should be the responsibility of ra-data-feathers. This library is just a connector between feathersClient and React Admin.

If you can explain why I'm wrong here, I'd be happy to write a pull request for you (as long as @josx is happy with it). Otherwise I'd suggest this issue should be closed as out of scope.

@josx
Copy link
Owner

josx commented Jun 5, 2020

Lets see what @lalote has to say before closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants