From 77abeb558e871b84845e9cc40a2990ada5a99d91 Mon Sep 17 00:00:00 2001 From: Mika Date: Thu, 11 Jul 2024 13:12:14 +0200 Subject: [PATCH] web: add support for adding a license --- web/src/client.ts | 11 +++++++++++ web/src/components/HeaderBar.vue | 33 +++++++++++++++++++++++++++----- web/src/components/MainPage.vue | 12 ++---------- web/src/types.ts | 2 ++ 4 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 web/src/client.ts diff --git a/web/src/client.ts b/web/src/client.ts new file mode 100644 index 0000000..76d122a --- /dev/null +++ b/web/src/client.ts @@ -0,0 +1,11 @@ +import axios from "axios"; +import { store } from "@/store"; +let axiosInstance = axios.create({ + baseURL: import.meta.env.VITE_BACKEND_URL, +}); +axiosInstance.interceptors.request.use((config) => { + config.headers.Authorization = `Bearer ${store.token}`; + return config; +}); + +export { axiosInstance }; diff --git a/web/src/components/HeaderBar.vue b/web/src/components/HeaderBar.vue index 2751807..da95bd9 100644 --- a/web/src/components/HeaderBar.vue +++ b/web/src/components/HeaderBar.vue @@ -215,6 +215,9 @@ + + Who am I??? +