Is it possible to have the variable `pass_or_fail` assigned within the `.then` clause and have that assignment reflected outside of the `.then` clause?
this.$http.post('http://localhost:3000/signup?username='+this.username+'&password='+this.password+'&password2='+this.password2)
//make get request to API with what USER entered into the search bar in the query string
.then(response => {
if(response.body == "success"){
this.pass_or_fail = response.body;
}
}
)
console.log(this.pass_or_fail);
if(this.pass_or_fail == "success"){
this.$router.push({name:'landing-page'});
}
//set sources variable to our response
}
However, when I try to log `this.pass_or_fail` outside of the `.then` clause, the variable has not been assigned the value of `response.body`. Any thoughts on why the change inside the `.then` clause is not being reflected outside of it?