redux-token-auth
redux-token-auth copied to clipboard
no signedIn:true on user registration
After registration the user should not be logged in automatically, the backend might need the user to do more actions before the user can log in, for example it might require: email verification, more info, confirmed payment or more.
The way I see it is the user being logged in after registration is a side effect, which we don't need, and we can easily avoid. (unless we rename this function: "registerAndSignInUser" which appears unnecessary)
Imho a better approach if you really want straight login after signup, would be to call register and then sign in. Such as:
dispatch(registerUser(data))
.then(response => dispatch(signInUser(data)))
You'll then be able to control precisely when to register, have the registration properly stored in your redux store history, and generally more atomic.