Open SWS-5007 opened 1 year ago
Hello, I found the solution for this issue.
Actually, Laravel JWT Middleware create any JWT Token as Bearer
Method.
So we need to send the token in axios request by adding the Bearer
.
Here is my correct codebase.
await axios
.get("http://localhost:8000/api/getTokenStatus", {
headers: {
Authorization: `Bearer ${access_token}`,
},
})
.then((res) => {
console.log(res.data);
})
.catch((error) => {
console.error(error);
});
I hope my experience will help you. Thanks.
Hi, Everyone. I am going to send the JWT Token in axios request header to laravel api.
Here is my codebase:
Here, I am getting the Authorization Token not found Error Msg from Laravel API JWT Middleware. This means, I didn't send the token correctly so that Laravel JWT Middleware can check the token. How should I send the token correctly? Please let me know.