Storing the token in local storage is not the most secure option as it can be vulnerable to cross-site scripting attacks. A better option would be to store the token in an HTTP-only cookie, which cannot be accessed by JavaScript and is therefore more secure.
To do this, you can modify the Laravel Sanctum configuration to use cookies instead of the default token-based authentication. In your config/sanctum.php file, set the stateful option to true and the driver option to cookie:
'stateful' => true,
'driver' => 'cookie',
Then, in your Vue app, you can use the axios library to send requests with the withCredentials option set to true, which will include the cookie in the request:
axios.get('/api/user', { withCredentials: true })
Finally, to make sure the cookie is secure, you should set the secure option to true in your config/session.php file, which will ensure that the cookie is only sent over HTTPS:
'secure' => true,
With these changes, your Sanctum token will be stored securely in an HTTP-only cookie and will be sent with every request, even after a page reload.