frontend: add config for endpoints

Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
Nicolas Froger 2024-07-25 12:47:45 +02:00
commit bfaa1c0014
No known key found for this signature in database
7 changed files with 19 additions and 7 deletions

View file

@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { API_BASE_URL } from '@/config.js'
export const useAuthStore = defineStore("auth", () => {
const adminToken = ref("");
@ -11,7 +12,7 @@ export const useAuthStore = defineStore("auth", () => {
isAuth.value = false;
error.value = false;
return fetch("http://localhost:8080/admin/auth/check", {
return fetch(API_BASE_URL + "/admin/auth/check", {
headers: {
"X-admin-token": token
}