mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-11 23:46:53 +02:00
Replace Vue globalProperties by provide/inject at app level
This commit is contained in:
parent
74d886a840
commit
df2407c46c
13
resources/js_vue3/app.js
vendored
13
resources/js_vue3/app.js
vendored
@ -11,15 +11,22 @@ import FontAwesomeIcon from './icons'
|
||||
const app = createApp(App)
|
||||
|
||||
// Immutable app properties provided by the laravel blade view
|
||||
app.config.globalProperties.$2fauth = {
|
||||
const $2fauth = {
|
||||
prefix: '2fauth_',
|
||||
config: window.appConfig, //{"proxyAuth":false,"proxyLogoutUrl":false,"subdirectory":""}
|
||||
version: window.appVersion,
|
||||
isDemoApp: window.isDemoApp,
|
||||
isTestingApp: window.isTestingApp,
|
||||
langs: window.appLocales
|
||||
langs: window.appLocales,
|
||||
}
|
||||
app.provide('2fauth', readonly($2fauth))
|
||||
|
||||
const pinia = createPinia()
|
||||
pinia.use(({ store }) => {
|
||||
store.$2fauth = $2fauth;
|
||||
});
|
||||
app.use(pinia)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(i18nVue, {
|
||||
lang: document.documentElement.lang.substring(0, 2),
|
||||
|
Loading…
x
Reference in New Issue
Block a user