71 lines
1.9 KiB
JavaScript
71 lines
1.9 KiB
JavaScript
import { createAuth } from '@websanova/vue-auth';
|
|
import driverAuthBearer from '@websanova/vue-auth/dist/drivers/auth/bearer.esm.js';
|
|
import driverHttpAxios from '@websanova/vue-auth/dist/drivers/http/axios.1.x.esm.js';
|
|
import driverRouterVueRouter from '@websanova/vue-auth/dist/drivers/router/vue-router.2.x.esm.js';
|
|
import axios from 'axios';
|
|
import { createApp } from 'vue';
|
|
import App from './App.vue';
|
|
import router from './router';
|
|
|
|
|
|
import Aura from '@primevue/themes/aura';
|
|
import PrimeVue from 'primevue/config';
|
|
import ConfirmationService from 'primevue/confirmationservice';
|
|
import ToastService from 'primevue/toastservice';
|
|
|
|
import BlockViewer from '@/components/BlockViewer.vue';
|
|
|
|
import '@/assets/styles.scss';
|
|
import '@/assets/tailwind.css';
|
|
import { config } from 'md-editor-v3';
|
|
|
|
|
|
|
|
config({
|
|
editorConfig: {
|
|
renderDelay: 0,
|
|
zIndex: 200000000
|
|
}
|
|
});
|
|
var auth = createAuth({
|
|
plugins: {
|
|
http: axios,
|
|
router: router
|
|
},
|
|
drivers: {
|
|
http: driverHttpAxios,
|
|
auth: driverAuthBearer,
|
|
router: driverRouterVueRouter
|
|
},
|
|
options:{
|
|
notFoundRedirect: '/auth/login',
|
|
authRedirect: '/auth/login',
|
|
loginData: {url: '../api/auth/login', method: 'POST', redirect: '/'},
|
|
logoutData: {url:'../api/auth/logout', redirect: '/auth/login'},
|
|
fetchData: {url: '../api/auth/fetch-user', method: 'GET', enabled: true},
|
|
refreshData: {url: '../api/auth/refresh-token', method: 'GET', enabled: true}
|
|
}
|
|
});
|
|
|
|
axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL;//'http://localhost:8081'
|
|
console.log(import.meta.env.VITE_BACKEND_URL);
|
|
|
|
const app = createApp(App);
|
|
|
|
app.use(router);
|
|
app.use(PrimeVue, {
|
|
theme: {
|
|
preset: Aura,
|
|
options: {
|
|
darkModeSelector: '.app-dark'
|
|
}
|
|
}
|
|
});
|
|
app.use(ToastService);
|
|
app.use(ConfirmationService);
|
|
app.use(auth);
|
|
|
|
app.component('BlockViewer', BlockViewer);
|
|
|
|
app.mount('#app');
|