mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
update Login to be able to force-reload the page
This commit is contained in:
parent
490092afee
commit
246c001f84
2 changed files with 9 additions and 3 deletions
|
@ -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 }) {
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue