Some more cleaning + fixes
[vchess.git] / client / src / views / Logout.vue
1 <template lang="pug">
2 main
3 .row
4 .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
5 p {{ st.tr["Logout successful!"] }}
6 </template>
7
8 <script>
9 import { store } from "@/store";
10 import { ajax } from "@/utils/ajax";
11 export default {
12 name: "my-logout",
13 data: function() {
14 return {
15 st: store.state
16 };
17 },
18 created: function() {
19 ajax(
20 "/logout",
21 "GET",
22 () => {
23 this.st.user.id = 0;
24 this.st.user.name = "";
25 this.st.user.email = "";
26 this.st.user.notify = false;
27 localStorage.removeItem("myid");
28 localStorage.removeItem("myname");
29 }
30 );
31 }
32 };
33 </script>