[Vuejs]-Laravel sanctum API tokens with Vue header error

0👍

use this instead

config.headers = {
    ...config.headers,
    'Authorization': `Bearer ${localStorage.getItem('token')}`,
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}

Leave a comment