X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FAuth.vue;h=a44687c1e4b56a6283b2d2a7a7765e2f2ebba622;hp=a750b3e32fa056307870f0b86b56d7d73557a453;hb=6808d7a16ec1e761c6a2dffec2281c96953e4d89;hpb=ae2c49bb0bbaac3953f63be5b720e9c6835f00b6 diff --git a/client/src/views/Auth.vue b/client/src/views/Auth.vue index a750b3e3..a44687c1 100644 --- a/client/src/views/Auth.vue +++ b/client/src/views/Auth.vue @@ -10,33 +10,31 @@ main import { store } from "@/store"; import { ajax } from "@/utils/ajax"; export default { - name: 'my-auth', + name: "my-auth", data: function() { return { st: store.state, - errmsg: "", + errmsg: "" }; }, created: function() { - ajax( - "/authenticate", - "GET", - {token: this.$route.params["token"]}, - (res) => { - if (!res.errmsg) //if not already logged in - { - this.st.user.id = res.id; - this.st.user.name = res.name; - this.st.user.email = res.email; - this.st.user.notify = res.notify; - localStorage["myname"] = res.name; - localStorage["myid"] = res.id; - } - else - this.errmsg = res.errmsg; - } + ajax( + "/authenticate", + "GET", + { token: this.$route.params["token"] }, + res => { + if (!res.errmsg) { + //if not already logged in + this.st.user.id = res.id; + this.st.user.name = res.name; + this.st.user.email = res.email; + this.st.user.notify = res.notify; + localStorage["myname"] = res.name; + localStorage["myid"] = res.id; + } else this.errmsg = res.errmsg; + } ); - }, + } };