Merge branch 'feature/vuejs' into feature/vuejs-serverlist
This commit is contained in:
commit
6b2649ad2c
18 changed files with 482 additions and 12 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue