Browse Source

Restore Demo flags

Bubka 3 years ago
parent
commit
5e0ea50e76

+ 1 - 0
app/Http/Controllers/SinglePageController.php

@@ -33,6 +33,7 @@ class SinglePageController extends Controller
         return view('landing')->with([
             'appSettings' => $this->settingService->all()->toJson(),
             'lang' => App::currentLocale(),
+            'isDemoApp' => config("2fauth.config.isDemoApp") ? 'true' : 'false',
             'locales' => collect(config("2fauth.locales"))->toJson(),
         ]);
     }

+ 2 - 1
resources/js/app.js

@@ -15,7 +15,8 @@ Vue.use(Notifications)
 const app = new Vue({
     el: '#app',
     data: {
-        appSettings: window.appSettings
+        appSettings: window.appSettings,
+        isDemoApp: window.isDemoApp
     },
     i18n,
     router,

+ 1 - 1
resources/js/components/App.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <kicker v-if="kickInactiveUser"></kicker>
-        <div v-if="$root.appSettings.isDemoApp" class="demo has-background-warning has-text-centered is-size-7-mobile">
+        <div v-if="this.$root.isDemoApp" class="demo has-background-warning has-text-centered is-size-7-mobile">
             {{ $t('commons.demo_do_not_post_sensitive_data') }}
         </div>
         <notifications width="100%" position="top" :duration="4000" :speed="0" :max="1" classes="notification is-radiusless" />

+ 1 - 1
resources/js/views/auth/Login.vue

@@ -42,7 +42,7 @@
         data(){
             return {
                 username: null,
-                isDemo: this.$root.appSettings.isDemoApp,
+                isDemo: this.$root.isDemoApp,
                 form: new Form({
                     email: '',
                     password: ''

+ 1 - 0
resources/views/landing.blade.php

@@ -25,6 +25,7 @@
     <script type="text/javascript">
         var appSettings = {!! $appSettings !!};
         var appVersion = '{{ config("2fauth.version") }}';
+        var isDemoApp = {!! $isDemoApp !!};
         var appLocales = {!! $locales !!};
     </script>
     <script src="{{ mix('js/manifest.js') }}"></script>