eddyystop / feathers-reduxify-authentication

Wrap feathers-client.authentication so it works with Redux, as well as authentication, authorization packages for React-Router.
MIT License
22 stars 13 forks source link

Naming of variables might be off. #12

Open testless opened 6 years ago

testless commented 6 years ago

Hi there,

if my understanding of this library is correct, the following variables should be the same, I guess:

https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L15 https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L57 https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L72 https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L83

Is this correct?

The payload of my auth call is { user: object, accessToken: string }

So action.payload.data should be action.payload[opts.user] https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L46 and [opts.data] in https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L57 https://github.com/eddyystop/feathers-reduxify-authentication/blob/master/src/index.js#L72

should be [opts.user]

testless commented 6 years ago

I made a PR. Seems clearer;)

eddyystop commented 6 years ago

Isn't user is the name of the user service?

testless commented 6 years ago

Yes, I think so, but I don't know what opts.data stands for. My guess, it is just a typo. feathers-redux doesn't handle auth, that is why I am still using this here.