mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			9 lines
		
	
	
		
			310 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
		
			310 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
export default function ({ store, redirect, route, app }) {
 | 
						|
  // If the user is not authenticated
 | 
						|
  if (!store.state.user.user) {
 | 
						|
    if (route.name === 'batch' || route.name === 'index') {
 | 
						|
      return redirect('/login')
 | 
						|
    }
 | 
						|
    return redirect(`/login?redirect=${encodeURIComponent(route.fullPath)}`)
 | 
						|
  }
 | 
						|
} |