Better login process

This commit is contained in:
Antoine Nguyen
2024-06-22 19:44:53 +02:00
committed by Spitfireap
parent ece58ddb93
commit 73cf7ba2ae
3 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -8,9 +8,9 @@ const _axios = axios.create()
_axios.interceptors.request.use(
function (config) {
const authStore = useAuthStore()
// Do something before request is sent
if (authStore.isAuthenticated) {
config.headers['Accept-Language'] = authStore.authUser.language
config.headers['Authorization'] = `Bearer ${authStore.getAccessToken()}`
}
return config
},