add failed login handling
This commit is contained in:
@@ -71,6 +71,7 @@
|
|||||||
@import '~bulma/sass/elements/button'
|
@import '~bulma/sass/elements/button'
|
||||||
@import '~bulma/sass/elements/form'
|
@import '~bulma/sass/elements/form'
|
||||||
@import '~bulma/sass/elements/icon'
|
@import '~bulma/sass/elements/icon'
|
||||||
|
@import '~bulma/sass/elements/notification'
|
||||||
@import '~bulma/sass/elements/other'
|
@import '~bulma/sass/elements/other'
|
||||||
@import '~bulma/sass/grid/columns'
|
@import '~bulma/sass/grid/columns'
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,11 @@
|
|||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<div class="notification is-danger" v-if="badLogin">
|
||||||
|
<button class="delete" @click="badLogin = false"></button>
|
||||||
|
Login failed
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -54,6 +59,7 @@
|
|||||||
return {
|
return {
|
||||||
email: '',
|
email: '',
|
||||||
password: '',
|
password: '',
|
||||||
|
badLogin: false,
|
||||||
sendTo: {},
|
sendTo: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -63,7 +69,11 @@
|
|||||||
|
|
||||||
store.dispatch('userLogin', { email, password })
|
store.dispatch('userLogin', { email, password })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this.badLogin = false;
|
||||||
this.$router.push(this.sendTo);
|
this.$router.push(this.sendTo);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.badLogin = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user