Add custom flash library that works as expected

This commit is contained in:
Dane Everitt 2018-05-26 14:50:38 -07:00
parent bab20812a0
commit 0a706d1b45
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
13 changed files with 233 additions and 37 deletions

View file

@ -43,6 +43,7 @@
submitToken: function () {
const self = this;
self.clearFlashes();
axios.post(this.route('auth.login-checkpoint'), {
confirmation_token: this.$route.query.token,
authentication_code: this.$data.code,
@ -57,7 +58,9 @@
const response = err.response;
if (response.data && _.isObject(response.data.errors)) {
self.flash({message: response.data.errors[0].detail, variant: 'danger'});
response.data.errors.forEach(function (error) {
self.error(error.detail);
});
self.$router.push({ name: 'login' });
}
});