webapp: Enforce login for config, firmware and reboot view

This commit is contained in:
Thomas Basler 2022-11-22 23:41:00 +01:00
parent 510f0c59f9
commit 1530dc6629
3 changed files with 13 additions and 3 deletions

View File

@ -112,7 +112,7 @@ import {
} from 'bootstrap-icons-vue';
import * as bootstrap from 'bootstrap';
import BootstrapAlert from "@/components/BootstrapAlert.vue";
import { handleResponse, authHeader } from '@/utils/authentication';
import { handleResponse, authHeader, isLoggedIn } from '@/utils/authentication';
export default defineComponent({
components: {
@ -137,6 +137,9 @@ export default defineComponent({
};
},
mounted() {
if (!isLoggedIn()) {
this.$router.push({ path: "/login", query: { returnUrl: this.$router.currentRoute.value.fullPath } });
}
this.modalFactoryReset = new bootstrap.Modal('#factoryReset');
this.loading = false;
},

View File

@ -77,7 +77,7 @@ import {
BIconArrowRepeat,
BIconCheckCircle
} from 'bootstrap-icons-vue';
import { authHeader } from '@/utils/authentication';
import { authHeader, isLoggedIn } from '@/utils/authentication';
export default defineComponent({
components: {
@ -184,6 +184,9 @@ export default defineComponent({
},
},
mounted() {
if (!isLoggedIn()) {
this.$router.push({ path: "/login", query: { returnUrl: this.$router.currentRoute.value.fullPath } });
}
this.loading = false;
},
});

View File

@ -47,7 +47,7 @@ import { defineComponent } from 'vue';
import * as bootstrap from 'bootstrap';
import BasePage from '@/components/BasePage.vue';
import BootstrapAlert from "@/components/BootstrapAlert.vue";
import { handleResponse, authHeader } from '@/utils/authentication';
import { handleResponse, authHeader, isLoggedIn } from '@/utils/authentication';
export default defineComponent({
components: {
@ -66,6 +66,10 @@ export default defineComponent({
};
},
mounted() {
if (!isLoggedIn()) {
this.$router.push({ path: "/login", query: { returnUrl: this.$router.currentRoute.value.fullPath } });
}
this.performReboot = new bootstrap.Modal('#performReboot');
},
methods: {