17 lines
548 B
TypeScript
17 lines
548 B
TypeScript
// file: src/plugins/authStore.js
|
|
|
|
import { useAuthStore } from "@/stores/authStore.ts";
|
|
import keycloakService from "@/services/keycloak";
|
|
import type { Pinia } from "pinia";
|
|
import type { App } from "vue";
|
|
// Setup auth store as a plugin so it can be accessed globally in our FE
|
|
const authStorePlugin = {
|
|
install(app: App, option: { pinia: Pinia }) {
|
|
const store = useAuthStore(option.pinia);
|
|
app.config.globalProperties.$store = store;
|
|
keycloakService.CallInitStore(store);
|
|
},
|
|
};
|
|
|
|
export default authStorePlugin;
|