Add JWT to login forms

This commit is contained in:
Dane Everitt 2018-05-28 12:48:42 -07:00
parent 47c1ecc9bc
commit ad69193ac0
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 93 additions and 6 deletions

View file

@ -49,9 +49,12 @@
authentication_code: this.$data.code,
})
.then(function (response) {
localStorage.setItem('token', response.data.token);
self.$store.dispatch('login');
window.location = response.data.intended;
})
.catch(function (err) {
self.$store.dispatch('logout');
if (!err.response) {
return console.error(err);
}