 FDHoho007
					
					1 year ago
						FDHoho007
					
					1 year ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
2 additions and 
6 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/core/public.rs
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -216,12 +216,8 @@ impl<'r> FromRequest<'r> for PublicToken { | 
			
		
	
		
		
			
				
					|  |  |         if time_now > claims.exp { |  |  |         if time_now > claims.exp { | 
			
		
	
		
		
			
				
					|  |  |             err_handler!("Token expired"); |  |  |             err_handler!("Token expired"); | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |         // Check if claims.iss is host|claims.scope[0]
 |  |  |         // Check if claims.iss is domain|claims.scope[0]
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         let host = match auth::Host::from_request(request).await { |  |  |         let complete_host = format!("{}|{}", CONFIG.domain_origin(), claims.scope[0]); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |             Outcome::Success(host) => host, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             _ => err_handler!("Error getting Host"), |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         }; |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         let complete_host = format!("{}|{}", host.host, claims.scope[0]); |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |         if complete_host != claims.iss { |  |  |         if complete_host != claims.iss { | 
			
		
	
		
		
			
				
					|  |  |             err_handler!("Token not issued by this server"); |  |  |             err_handler!("Token not issued by this server"); | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
	
		
		
			
				
					|  | 
 |