Experimental update: preview corr move + allow deletion of any game
[vchess.git] / client / src / views / Auth.vue
... / ...
CommitLineData
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
5 div(v-if="authOk")
6 p {{ st.tr["Authentication successful!"] }}
7</template>
8
9<script>
10import { store } from "@/store";
11import { ajax } from "@/utils/ajax";
12export default {
13 name: "my-auth",
14 data: function() {
15 return {
16 st: store.state,
17 authOk: false
18 };
19 },
20 created: function() {
21 ajax(
22 "/authenticate",
23 "GET",
24 { token: this.$route.params["token"] },
25 res => {
26 this.authOk = true;
27 this.st.user.id = res.id;
28 this.st.user.name = res.name;
29 this.st.user.email = res.email;
30 this.st.user.notify = res.notify;
31 localStorage["myname"] = res.name;
32 localStorage["myid"] = res.id;
33 }
34 );
35 }
36};
37</script>