Redux FAQ: Miscellaneous

    Miscellaneous

    Further information

    Documentation

    How can I implement authentication in Redux?

    • Create action creators that take in credentials, a flag that signifies whether authentication succeeded, a token, or an error message as the payload.

    • Create an async action creator with Redux Thunk middleware or any middleware you see fit to fire a network request to an API that returns a token if the credentials are valid. Then save the token in the local storage or show a response to the user if it failed. You can perform these side effects from the action creators you wrote in the previous step.

    Further information

    Articles