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:
		
							parent
							
								
									ac5231c657
								
							
						
					
					
						commit
						e131305902
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue