How to pass Header JWT Token with Axios & React?

前端 未结 4 857
你的背包
你的背包 2021-01-31 11:57

I make web application with React, Express, MongoDB.

And, I want to pass jwt token with header.

But, I pass it, get 401 error (Unauthorized).

In login ac

4条回答
  •  有刺的猬
    2021-01-31 12:23

    Try res.header('x-auth', token).send() 'x-auth' can be anything. Above is used to set token in the headers

提交回复
热议问题