Open wzup opened 8 years ago
No idea if I am right or not, but the response is the JSON value returned from the server..
In this case, { token: '3fj39jf9j3f' }
I'm not sure why he has the jwtDecode line in there, as he never ends up using decoded. Thus it is actually the token, and also you can really pass in any object key into the action object. I'm guessing payload is just a common word for the 'data' embedded in an action.
Here is an operation from https://github.com/joshgeller/react-redux-jwt-auth-example/blob/master/src/actions/index.js#L63.
In
decoded
varibale in not a token. It is only a payload object which is only one third of a token.And in
loginUserSuccess
action you have:Why do you call a payload data a token?