debugs
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 44s
All checks were successful
Deploy API / deploy (ubuntu-latest, 2.44.0) (push) Successful in 44s
This commit is contained in:
parent
dc81c85f53
commit
158e42b053
@ -1,6 +1,8 @@
|
|||||||
package cc.pulseapp.api.config;
|
package cc.pulseapp.api.config;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
@ -9,13 +11,20 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||||||
/**
|
/**
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration @Log4j2(topic = "App Config")
|
||||||
public class AppConfig {
|
public class AppConfig {
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
log.info("App Config initialized");
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public WebMvcConfigurer configureCors() {
|
public WebMvcConfigurer configureCors() {
|
||||||
return new WebMvcConfigurer() {
|
return new WebMvcConfigurer() {
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
||||||
|
log.info("Configuring CORS...");
|
||||||
|
|
||||||
// Allow all origins to access the API
|
// Allow all origins to access the API
|
||||||
registry.addMapping("*")
|
registry.addMapping("*")
|
||||||
.allowedOrigins("*") // Allow all origins
|
.allowedOrigins("*") // Allow all origins
|
||||||
|
@ -25,8 +25,7 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
|||||||
/**
|
/**
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration @EnableWebSecurity
|
||||||
@EnableWebSecurity
|
|
||||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
public class WebSecurityConfig {
|
public class WebSecurityConfig {
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user