Some more cleaning + fixes
[vchess.git] / client / src / views / Auth.vue
index a44687c..36e79c8 100644 (file)
@@ -2,8 +2,7 @@
 main
   .row
     .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
-      p(:class="{warn:!!this.errmsg}")
-        | {{ errmsg || st.tr["Authentication successful!"] }}
+      p {{ st.tr["Authentication successful!"] }}
 </template>
 
 <script>
@@ -13,8 +12,7 @@ export default {
   name: "my-auth",
   data: function() {
     return {
-      st: store.state,
-      errmsg: ""
+      st: store.state
     };
   },
   created: function() {
@@ -23,25 +21,14 @@ export default {
       "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;
+        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;
       }
     );
   }
 };
 </script>
-
-<style lang="sass" scoped>
-.warn
-  padding: 3px
-  color: red
-  background-color: lightgrey
-  font-weight: bold
-</style>