Merge branch 'feature/vuejs' into feature/vuejs-serverlist

This commit is contained in:
Dane Everitt 2018-06-02 17:12:45 -07:00
commit 6b2649ad2c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
18 changed files with 482 additions and 12 deletions

View file

@ -37,6 +37,10 @@
};
},
mounted: function () {
if ((this.$route.query.token || '').length < 1) {
return this.$router.push({ name: 'login' });
}
this.$refs.code.focus();
},
methods: {
@ -49,8 +53,13 @@
authentication_code: this.$data.code,
})
.then(function (response) {
if (!(response.data instanceof Object)) {
throw new Error('An error was encountered while processing this login.');
}
localStorage.setItem('token', response.data.token);
self.$store.dispatch('login');
window.location = response.data.intended;
})
.catch(function (err) {