Force redirect to login page, if settings say so

this is pretty rudimentary, probably needs to be smarter or else should maybe
just be defined within final app instead of byjove
This commit is contained in:
Lance Edgar 2020-02-10 14:18:28 -06:00
parent ac5231c657
commit e131305902

View file

@ -51,6 +51,13 @@ export default {
this.$router.push('/')
}
// if so configured, redirect to login if anonymous visits home page
if (this.appsettings.forceLogin) {
if (!response.data.user && this.$route.name == 'home') {
this.$router.push('/login')
}
}
// set background color, to whatever api said
if (response.data.background_color) {
document.body.style.backgroundColor = response.data.background_color