Skip to content

Commit

Permalink
addCorsMappings add
Browse files Browse the repository at this point in the history
  • Loading branch information
programmerDH-github committed Jun 18, 2024
1 parent 4509ce7 commit 9f0d161
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/bside/BSIDE/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.web.servlet.config.annotation.CorsRegistry;

import com.bside.BSIDE.jwt.exception.CustomAuthenticationEntryPoint;

Expand Down Expand Up @@ -61,6 +62,13 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http.build();
}

public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:8080")
.exposedHeaders("name","token")
.allowCredentials(true);
}

@Bean
public PasswordEncoder passwordEncoder(){
return new BCryptPasswordEncoder();
Expand Down

0 comments on commit 9f0d161

Please sign in to comment.