mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 21:36:52 +01:00 
			
		
		
		
	Avoid getting stuck in an endless redirect loop...
This commit is contained in:
		
							parent
							
								
									1acedc2de2
								
							
						
					
					
						commit
						ca0c35bf82
					
				| @ -52,16 +52,6 @@ router.beforeEach((to, from, next) => { | |||||||
| 
 | 
 | ||||||
|     const user = store.getters['auth/getUser']; |     const user = store.getters['auth/getUser']; | ||||||
| 
 | 
 | ||||||
|     // If user is trying to access the authentication endpoints but is already authenticated
 |  | ||||||
|     // don't try to load them, just send the user to the dashboard.
 |  | ||||||
|     if (to.path.startsWith('/auth')) { |  | ||||||
|         if (user !== null && compareDate(addHours(dateParse(user.getJWT().iat * 1000), 12), new Date()) >= 0) { |  | ||||||
|             return window.location = '/'; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         return next(); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     // If user is trying to access any of the non-authentication endpoints ensure that they have
 |     // If user is trying to access any of the non-authentication endpoints ensure that they have
 | ||||||
|     // a valid, non-expired JWT.
 |     // a valid, non-expired JWT.
 | ||||||
|     if (!to.path.startsWith('/auth')) { |     if (!to.path.startsWith('/auth')) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dane Everitt
						Dane Everitt