Migrate to Vite

This commit is contained in:
Karolis2011
2022-01-25 22:05:37 +02:00
parent df48e88614
commit 0b19ee33a8
15 changed files with 806 additions and 13613 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,7 +1,7 @@
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');
@import 'custom';
@import '~bootstrap/scss/bootstrap';
@import 'bootstrap/scss/bootstrap';
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css');
/* Enter and leave animations can use different */

View File

@@ -11,6 +11,4 @@ const app = createApp(App)
app.use(router)
app.use(store)
app.mount('#app')
window.r = router
app.mount('#app')

View File

@@ -1,5 +1,4 @@
import * as msal from '@azure/msal-browser'
import Cookies from 'cookies-js'
import axios from 'axios'
const ClientIdCookieName = 'ktusakacas'
@@ -122,23 +121,8 @@ function __stateChanged() {
msalState.stateChangeCallbacks.forEach(cb => cb())
}
function __isLocalStorageAvailable() {
try {
localStorage.setItem('__lsTest', 'true')
const result = localStorage.getItem('__lsTest')
localStorage.removeItem('__lsTest')
return result == 'true'
} catch (e) {
return false
}
}
async function __loadAuthParameters() {
if (__isLocalStorageAvailable()) {
await __loadAuthParametersLocalStorage()
} else {
await __loadAuthParametersCookies()
}
await __loadAuthParametersLocalStorage()
}
async function __loadAuthParametersLocalStorage() {
@@ -157,22 +141,6 @@ async function __loadAuthParametersLocalStorage() {
}
}
async function __loadAuthParametersCookies() {
const clientId = Cookies.get(ClientIdCookieName)
const authority = Cookies.get(AuthorityCookieName)
const tenant = Cookies.get(TenantCookieName)
if (clientId == null || authority == null || tenant == null) {
await __fetchAuthParameters()
Cookies.set(ClientIdCookieName, msalState.clientId)
Cookies.set(AuthorityCookieName, msalState.authority)
Cookies.set(TenantCookieName, msalState.tenant)
} else {
msalState.clientId = clientId
msalState.authority = authority
msalState.tenant = tenant
}
}
async function __fetchAuthParameters() {
var response = await axios.get('/api/AuthMetadata')
msalState.clientId = response.data.clientId