-1👍
Your token should be inside the Bearer like this:
beforeCreated() {
const token = localStorage.getItem("token")
if (token) {
axios.defaults.headers.common['Authorization'] = `"Bearer ${token}"`
} else {
axios.defaults.headers.common['Authorization'] = ""
}
}
Source:stackexchange.com