Commit d3796de8 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade bean para configurar cors

parent a51ab94a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
package es.redmic.user.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CorsConfiguration implements WebMvcConfigurer {

	@Override
	public void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/**");
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ public class Oauth2SecurityConfiguration {
		public void configure(HttpSecurity http) throws Exception {
			// @formatter:off
			
			http.cors().and().anonymous().and().authorizeRequests().antMatchers("/user/actuator/**").permitAll()
					.antMatchers(HttpMethod.OPTIONS, "/**/").permitAll()
			http.cors().disable().anonymous().and().authorizeRequests().antMatchers("/user/actuator/**").permitAll()
					.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
					.antMatchers(HttpMethod.GET, "/user/profile/").permitAll()
					.antMatchers(HttpMethod.GET, "/user/modules/openmodules/").permitAll()
					.antMatchers(HttpMethod.POST, "/user/register/**/").permitAll()
+0 −2
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@ management.endpoints.web.exposure.include=health, info, prometheus
spring.application.name=api user
spring.aop.proxy-target-class=true

spring.mvc.dispatch-options-request=true

recaptcha.secret=secret

#oauth