From 949c5d52070525957e6d49a5d15263d918307684 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Mon, 13 Jan 2025 23:45:16 +0330 Subject: [PATCH] Update axios --- frontend/plugins/axios.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/plugins/axios.ts b/frontend/plugins/axios.ts index 072c83b..22afc9c 100644 --- a/frontend/plugins/axios.ts +++ b/frontend/plugins/axios.ts @@ -4,19 +4,17 @@ import { API_ENDPOINTS } from "~/constants"; export default defineNuxtPlugin(() => { const config = useRuntimeConfig(); - const { logout } = useAuth(); + const { logout, token } = useAuth(); const axios = axiosOriginal.create({ baseURL: config.public.API_BASE_URL }); - axios.interceptors.request.use((config) => { if ( !config.url?.includes(API_ENDPOINTS.auth.signin) && !config.url?.includes(API_ENDPOINTS.account.send_otp) ) { - const { token } = useAuth(); config.headers.Authorization = `Bearer ${token.value}`; }