Redirect when received a 401 error

This commit is contained in:
Donald Zou
2024-08-04 01:31:31 -04:00
parent 6825d728c2
commit 6cf4eba20a
6 changed files with 85 additions and 63 deletions
+13
View File
@@ -1,9 +1,11 @@
<script>
import {fetchGet, fetchPost} from "../utilities/fetch.js";
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
import Message from "@/components/messageCentreComponent/message.vue";
export default {
name: "signin",
components: {Message},
async setup(){
const store = DashboardConfigurationStore()
let theme = ""
@@ -26,6 +28,11 @@ export default {
loading: false
}
},
computed: {
getMessages(){
return this.store.Messages.filter(x => x.show)
}
},
methods: {
async auth(){
if (this.username && this.password && ((this.totpEnabled && this.totp) || !this.totpEnabled)){
@@ -125,6 +132,12 @@ export default {
WGDashboard v4.0 | Developed with ❤️ by
<a href="https://github.com/donaldzou" target="_blank"><strong>Donald Zou</strong></a>
</small>
<div class="messageCentre text-body position-absolute end-0 margin-3">
<TransitionGroup name="message" tag="div" class="position-relative">
<Message v-for="m in getMessages.slice().reverse()"
:message="m" :key="m.id"></Message>
</TransitionGroup>
</div>
</div>
</template>