update de la cors
This commit is contained in:
		
							parent
							
								
									2d01f65c95
								
							
						
					
					
						commit
						8a2ac5be69
					
				| @ -54,7 +54,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { | ||||
|                         if (isRateLimited(authorUuid, request)) { | ||||
|                             response.setStatus(429); // TOO MANY REQUESTS | ||||
|                             response.setCharacterEncoding("UTF-8"); | ||||
|                             response.getWriter().write("{\"message\":\"Vous avez envoyé trop de requête d'un coups, patientez un  peu...\"}"); | ||||
|                             response.getWriter().write("{\"message\":\"Vous avez envoyé trop de requête d'un coups, patientez un peu...\"}"); | ||||
|                             return; | ||||
|                         } | ||||
| 
 | ||||
|  | ||||
| @ -52,8 +52,7 @@ public class SpringSecurityConfig { | ||||
|     @Bean | ||||
|     public CorsConfigurationSource corsConfigurationSource() { | ||||
|         CorsConfiguration configuration = new CorsConfiguration(); | ||||
| //        configuration.setAllowedOrigins(List.of("http://192.168.1.35:4200")); | ||||
|         configuration.setAllowedOrigins(List.of("http://localhost:4200")); | ||||
|         configuration.setAllowedOrigins(List.of("https://abonentendeur.guams.fr", "http://192.168.1.35:4200", "http://localhost:4200")); | ||||
|         configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE")); // Méthodes HTTP autorisées | ||||
|         configuration.setAllowedHeaders(List.of("Authorization", "Content-Type")); // En-têtes autorisés | ||||
|         configuration.setAllowCredentials(true); // Permet l'utilisation des cookies ou des tokens | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Guams
						Guams