Browse Source
			
			
			remove admin_path function
			
				since it just returns a const
			
			
				pull/3870/merge^2
			
			
		 
		
			
				
					
						
						BlockListed
					
					2 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 2D204777C477B588
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
4 additions and 
3 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/admin.rs
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -125,9 +125,10 @@ impl<'r> FromRequest<'r> for IpHeader { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					fn admin_url(base_url: &str) -> String { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    format!("{}{}", base_url, admin_path()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    format!("{}{}", base_url, ADMIN_PATH) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#[derive(Responder)] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					enum AdminResponse { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    #[response(status = 200)] | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -197,7 +198,7 @@ fn post_admin_login(data: Form<LoginForm>, cookies: &CookieJar<'_>, ip: ClientIp | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        cookies.add(cookie); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if let Some(redirect) = redirect { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Ok(Redirect::to(format!("{}{}", admin_path(), redirect))) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Ok(Redirect::to(format!("{}{}", ADMIN_PATH, redirect))) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Err(AdminResponse::Ok(render_admin_page())) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |