From b8a9acbaeb6683105f3fa80a0195a2e486a612c6 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Wed, 11 Sep 2024 16:08:32 +0700 Subject: [PATCH] refactor: move flow into interceptor --- src/boot/axios.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/boot/axios.ts b/src/boot/axios.ts index 87b93766..7f8767e3 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -3,6 +3,7 @@ import { boot } from 'quasar/wrappers'; import { getToken } from 'src/services/keycloak'; import { dialog } from 'stores/utils'; import useLoader from 'stores/loader'; +import useFlowStore from 'src/stores/flow'; declare module '@vue/runtime-core' { interface ComponentCustomProperties { @@ -32,6 +33,7 @@ function parseError( api.interceptors.request.use(async (config) => { useLoader().show(); config.headers.Authorization = `Bearer ${await getToken()}`; + config.headers['X-Rtid'] = useFlowStore().rtid; return config; });