Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ This project is licensed under the **MIT License**. See the [LICENSE](./LICENSE)

For questions, suggestions, or collaboration:

- GitHub Issues: [Submit here](https://github.com/PKTTTeam/PKWMTT-backend/issues)
- Team: [@PKTTTeam](https://github.com/PKTTTeam)
- GitHub Issues: [Submit here](https://github.com/PKWMApp/PKWMTT-backend/issues)
- Team: [@PKWMApp](https://github.com/PKWMApp
)

---

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/pkwmtt/security/cors/SecurityCorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
*/
@Configuration
public class SecurityCorsConfig {

/**
* @return UrlBasedCorsConfigurationSource with CORS configuration for spring security
* added to SecurityFilterChain by .cors(withDefaults())
*/
@Bean
CorsConfigurationSource corsConfigurationSource() {
CorsConfigurationSource corsConfigurationSource () {
CorsConfiguration config = new CorsConfiguration();
config.setAllowedOrigins(List.of("https://pkwmapp.pl"));
config.setAllowedOrigins(List.of("https://pkwmapp.pl", "http://localhost:3000"));
config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS"));
config.setAllowedHeaders(List.of("*"));
config.setAllowCredentials(true); //???

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/pkmwtt/api/**", config);

return source;
}
}