diff client/src/components/Sidebar.vue @ 1701:f4bd67daaaff

feat: force login on invalid session Redirect user to login when session becomes invalid. Prototypical implementation for importqueue.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 07 Jan 2019 12:13:52 +0100
parents 90211725e4a9
children b24a54c684bd
line wrap: on
line diff
--- a/client/src/components/Sidebar.vue	Mon Jan 07 11:35:35 2019 +0100
+++ b/client/src/components/Sidebar.vue	Mon Jan 07 12:13:52 2019 +0100
@@ -136,7 +136,7 @@
  * Markus Kottländer <markus.kottlaender@intevation.de>
  */
 import { mapGetters, mapState } from "vuex";
-import app from "@/main";
+import { logOff } from "@/lib/session.js";
 
 export default {
   name: "sidebar",
@@ -175,10 +175,7 @@
   IMPORTSTRETCHES: process.env.VUE_APP_FEATURE_IMPORTSTRETCHES,
   methods: {
     logoff() {
-      app.$snotify.clear();
-      this.$store.commit("reset");
-      this.$store.commit("user/clearAuth");
-      this.$router.push("/login");
+      logOff();
     },
     toggleContextBox(context) {
       if (this.$route.path !== "/") this.$router.push("/");