mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-02-18 00:02:02 +03:00
chore: cleanup route check
This commit is contained in:
parent
f845c0a802
commit
a5e2b4a31f
1 changed files with 4 additions and 4 deletions
|
@ -29,6 +29,9 @@ export default {
|
||||||
...mapGetters(['getAuthenticated']),
|
...mapGetters(['getAuthenticated']),
|
||||||
isAuthenticated() {
|
isAuthenticated() {
|
||||||
return this.getAuthenticated()
|
return this.getAuthenticated()
|
||||||
|
},
|
||||||
|
onLoginPage() {
|
||||||
|
return this.$router.currentRoute.name.includes('login')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -42,10 +45,7 @@ export default {
|
||||||
const authenticated = res === 'Ok.'
|
const authenticated = res === 'Ok.'
|
||||||
this.$store.commit('LOGIN', authenticated)
|
this.$store.commit('LOGIN', authenticated)
|
||||||
this.$store.commit('updateMainData')
|
this.$store.commit('updateMainData')
|
||||||
if (
|
if (!authenticated && !this.onLoginPage) return this.$router.push('login')
|
||||||
!authenticated &&
|
|
||||||
!this.$router.currentRoute.name.includes('login')
|
|
||||||
) this.$router.push('login')
|
|
||||||
},
|
},
|
||||||
checkDeviceDarkTheme() {
|
checkDeviceDarkTheme() {
|
||||||
if (this.webuiSettings.useDeviceDarkMode) {
|
if (this.webuiSettings.useDeviceDarkMode) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue