mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
parent
5c903502e8
commit
5f61597125
3 changed files with 9 additions and 4 deletions
|
|
@ -127,8 +127,9 @@ router.beforeEach((to, from, next) => {
|
||||||
if (!['read-book', 'browse-book', 'browse-series'].includes(<string>to.name)) {
|
if (!['read-book', 'browse-book', 'browse-series'].includes(<string>to.name)) {
|
||||||
document.title = 'Komga'
|
document.title = 'Komga'
|
||||||
}
|
}
|
||||||
if (to.name !== 'startup' && to.name !== 'login' && !lStore.getters.authenticated) next({ name: 'startup' })
|
if (to.name !== 'startup' && to.name !== 'login' && !lStore.getters.authenticated) {
|
||||||
else next()
|
next({ name: 'startup', query: { redirect: to.fullPath } })
|
||||||
|
} else next()
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,11 @@ export default Vue.extend({
|
||||||
|
|
||||||
await this.$store.dispatch('getLibraries')
|
await this.$store.dispatch('getLibraries')
|
||||||
|
|
||||||
|
if (this.$route.query.redirect) {
|
||||||
|
this.$router.push({ path: this.$route.query.redirect.toString() })
|
||||||
|
} else {
|
||||||
this.$router.push({ name: 'home' })
|
this.$router.push({ name: 'home' })
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.showSnack(e.message)
|
this.showSnack(e.message)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default Vue.extend({
|
||||||
await this.$store.dispatch('getLibraries')
|
await this.$store.dispatch('getLibraries')
|
||||||
this.$router.back()
|
this.$router.back()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$router.push({ name: 'login' })
|
this.$router.push({ name: 'login', query: { redirect: this.$route.query.redirect } })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue