mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Fixed token retrieval
This commit is contained in:
@@ -6,11 +6,12 @@ import { useAuthStore } from '@/stores'
|
||||
const _axios = axios.create()
|
||||
|
||||
_axios.interceptors.request.use(
|
||||
function (config) {
|
||||
async function (config) {
|
||||
const authStore = useAuthStore()
|
||||
if (authStore.isAuthenticated) {
|
||||
const token = await authStore.getAccessToken()
|
||||
config.headers['Accept-Language'] = authStore.authUser.language
|
||||
config.headers['Authorization'] = `Bearer ${authStore.getAccessToken()}`
|
||||
config.headers['Authorization'] = `Bearer ${token}`
|
||||
}
|
||||
return config
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user