Open altwohill opened 7 years ago
Yes, when using feathers-authentication v1 user in redux is null. This is a showstopper!
The simplest way to solve this would be to add an after create hook to the authentication
service on the server. Query the user from the /users
service and add it to hook.result. We already created a full page in the Feathers documentation that explains how to make this happen. I really recommend reading the new documentation in full. We have put it within your grasp to unstop the show! :wink:
Plerase reopen the issue if you don't feel its resolved.
Reopening so others can see solution.
Here is the link to the docs page: https://docs.feathersjs.com/guides/auth/recipe.customize-response.html
One note, in order to work with feathers-reduxify-authentication, the hook should send the user information as result.data
hook => {
hook.result.data = hook.params.user;
// Don't expose sensitive information.
delete hook.result.data.password;
}
Using feathers-authentication v1, we're expected to fetch user details separately from authenticating. This means store.auth.user is currently empty after authenticating.
Would much need to change to put some user details in there? I guess at the least it should put the ID extracted from the JWT into it.