I have the code below:
let auth = '';
Data.loginRedirect(auth)
.then(response => {
this.var = response.data;
auth= this.var;
console.log(auth); //outputs array
})
console.log(auth); //outputs nothing ''
if ((auth) != '') {
alert('Email already used!');
}
In this code, I need auth to be updated with the array value after LoginRedirect runs to use in the if statement. How can I do this?
Aucun commentaire:
Enregistrer un commentaire