Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
login() {
let loading = this.loadingCtrl.create({
content: 'Please wait...'
});
loading.present();
let details = this.loginDetails;
console.log('login..');
this.user.login(details.username, details.password).then((result) => {
console.log('result:', result);
loading.dismiss();
this.navCtrl.setRoot(TabsPage);
}).catch((err) => {
if (err.message === "User is not confirmed.") {
loading.dismiss();
this.navCtrl.push(ConfirmPage, { 'username': details.username });
}
console.log('errrror', err);
loading.dismiss();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment