Pierre Tellier 645a10477d
All checks were successful
CI / build (push) Successful in 4s
feat: now respect codestyle
2025-02-09 15:59:30 +01:00

32 lines
925 B
TypeScript

import { createApp } from "vue";
import App from "./App.vue";
import router from "./router/router.ts";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import keycloakService from "./services/keycloak";
import { type AuthStore, useAuthStore } from "@/stores/authStore.ts";
let store: AuthStore;
keycloakService.CallInit(() => {
try {
const app = createApp(App);
// Setup pinia store, allowing user to keep logged in status after refresh
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.use(pinia);
store = useAuthStore();
keycloakService.CallInitStore(store);
app.use(router);
app.mount("#app");
} catch (e) {
console.error("Error while initiating Keycloak.");
console.error(e);
createApp(App).mount("#app");
}
});
export { store };