diff --git a/app/src/store/info.js b/app/src/store/info.js index 9ca3fad7..ff3b42c4 100644 --- a/app/src/store/info.js +++ b/app/src/store/info.js @@ -103,7 +103,6 @@ export default { 'CONNECT' ({ commit, dispatch }) { commit('SET_CONNECTED', true) dispatch('GET_YUNOHOST_INFOS') - router.push(router.currentRoute.query.redirect || { name: 'home' }) }, 'RESET_CONNECTED' ({ commit }) { diff --git a/app/src/views/Login.vue b/app/src/views/Login.vue index 190447d6..db50f4e6 100644 --- a/app/src/views/Login.vue +++ b/app/src/views/Login.vue @@ -33,7 +33,8 @@ export default { name: 'Login', props: { - skipInstallCheck: { type: Boolean, default: false } + skipInstallCheck: { type: Boolean, default: false }, + forceReload: { type: Boolean, default: false } }, data () { @@ -47,7 +48,13 @@ export default { methods: { login () { - this.$store.dispatch('LOGIN', this.password).catch(err => { + this.$store.dispatch('LOGIN', this.password).then(() => { + if (this.forceReload) { + window.location.href = '/yunohost/admin/' + } else { + this.$router.push(this.$router.currentRoute.query.redirect || { name: 'home' }) + } + }).catch(err => { if (err.name !== 'APIUnauthorizedError') throw err this.isValid = false })