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