title: Authentication credentials are not provided - Axios
body: <p>here is my action of redux:</p>
  <pre><code>
  export const addToWishlist = (id) =&gt; async (dispatch, getState) =&gt; {
      try {
          const {
              userLogin: { userInfo },
          } = getState()
  
          const config = {
              headers: {
  
                  'Authorization': `JWT ${userInfo.token}`
              }
          }
  
          const { data } = await axios.post(`/api/wishlist/add_to_wishlist/${id}/`, config
          )
  
  
          dispatch({
              type: WISHLIST_ADD_ITEM,
              payload: data
          })
  
  
  
  
          localStorage.setItem('wishlistItems', JSON.stringify(getState().wishlist.wishlistItemsFromStorage))
      } catch (error) {
          dispatch({
              type: WISHLIST_ADD_ITEM_FAIL,
              payload: error.response &amp;&amp; error.response.data.detail
                  ? error.response.data.detail
                  : error.message,
          })
      }
  }
  </code></pre>
  <p>so i tried to send a post request to this api end point <code>/api/wishlist/add_to_wishlist/${id}/</code> it says in response(from redux extension)</p>
  <pre><code>type:&quot;WISHLIST_ADD_ITEM_FAIL&quot;
  payload:&quot;Authentication credentials were not provided.&quot;
  
  </code></pre>
  <p><code>Authentication credentials we…provided.</code>
  but when I tried the same end point using postman it worked i.e. it add the item to wishlist.</p>
  <p><a href="https://i.stack.imgur.com/oqC6h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oqC6h.png" alt="postman image" /></a></p>
  <p><strong>What I tried</strong></p>
  <ul>
  <li>I tried to copy the token from console and paste it on postman it worked but again not on frontend</li>
  <li>i even tried to hard copy the same token from postman to action code and it still says the same error</li>
  <li>I tried change the config code and added content-type = applicaton/json but all in vain.</li>
  </ul>
  <hr />
  <p>so can you please help me. Thanks .if you are curious here is view:</p>
  <pre><code>
  @api_view(['POST'])
  @csrf_exempt
  @permission_classes([IsAuthenticated])
  def add_to_wishlist(request, id):
      product = get_object_or_404(Product, _id=id)
      if product.users_wishlist.filter(id=request.user.id).exists():
          product.users_wishlist.remove(request.user)
      else:
          product.users_wishlist.add(request.user)
      return Response('your item is add to the wishlist ')
  </code></pre>
  <hr />