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!"] }}
+ div(v-if="authOk")
+ p {{ st.tr["Authentication successful!"] }}
+ p {{ st.tr["Back to Hall in 3 seconds..."] }}
</template>
<script>
data: function() {
return {
st: store.state,
- errmsg: ""
+ authOk: false
};
},
created: function() {
"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.authOk = true;
+ 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;
+ setTimeout(() => {
+ this.$router.replace("/");
+ }, 3000);
}
);
}
};
</script>
-
-<style lang="sass" scoped>
-.warn
- padding: 3px
- color: red
- background-color: lightgrey
- font-weight: bold
-</style>