Small fix + attempt to improve socket messages reliability...
[vchess.git] / client / src / views / Logout.vue
index 1740c7d..919e492 100644 (file)
@@ -4,7 +4,6 @@ main
     .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
       div(v-if="logoutOk")
         p {{ st.tr["Logout successful!"] }}
-        p {{ st.tr["Back to Hall in 3 seconds..."] }}
 </template>
 
 <script>
@@ -22,17 +21,17 @@ export default {
     ajax(
       "/logout",
       "GET",
-      () => {
-        this.logoutOk = true;
-        this.st.user.id = 0;
-        this.st.user.name = "";
-        this.st.user.email = "";
-        this.st.user.notify = false;
-        localStorage.removeItem("myid");
-        localStorage.removeItem("myname");
-        setTimeout(() => {
-          this.$router.replace("/");
-        }, 3000);
+      {
+        credentials: true,
+        success: () => {
+          this.logoutOk = true;
+          this.st.user.id = 0;
+          this.st.user.name = "";
+          this.st.user.email = "";
+          this.st.user.notify = false;
+          localStorage.removeItem("myid");
+          localStorage.removeItem("myname");
+        }
       }
     );
   }