function logout () {
  return dispatch => {
    dispatch(logoutRequest())
    return appAuthToken.getSessionToken()

      .then((token) => {
        return BackendFactory(token).logout()
      })

      .then(() => {
        dispatch(loginState())
        dispatch(logoutSuccess())
        dispatch(deleteSessionToken())
        Actions.InitialLoginForm()
      })

      .catch((error) => {
        dispatch(loginState())
        dispatch(logoutFailure(error))
      })
  }
}
## Login
After dispatching the logoutRequest, get the sessionToken


When the response is received and it's valid
change the state to register and finish the logout

But if the call fails, like expired token or
no network connection, just send the failure

And if you fail due to an invalid sessionToken, be sure
to delete it so the user can log in.

How could there be an invalid sessionToken?  Maybe they
haven't used the app for a long time.  Or they used another
device and logged out there.