File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/main/java/es/in2/vcverifier/config Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111### Changed
1212- Make login QR padding white.
13+ ### Fixed
14+ - Add WebSockets CORS.
1315
1416## [ v2.0.0] ( https://github.com/in2workspace/in2-verifier-api/releases/tag/v2.0.0 )
1517- New major version to align with the new major version of EUDIStack project.
Original file line number Diff line number Diff line change 11package es .in2 .vcverifier .config ;
22
3+ import lombok .RequiredArgsConstructor ;
34import org .springframework .context .annotation .Configuration ;
45import org .springframework .messaging .simp .config .MessageBrokerRegistry ;
56import org .springframework .web .socket .config .annotation .EnableWebSocketMessageBroker ;
67import org .springframework .web .socket .config .annotation .StompEndpointRegistry ;
78import org .springframework .web .socket .config .annotation .WebSocketMessageBrokerConfigurer ;
89
910@ Configuration
11+ @ RequiredArgsConstructor
1012@ EnableWebSocketMessageBroker
1113public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
1214
15+ private final BackendConfig backendConfig ;
16+
1317 @ Override
1418 public void configureMessageBroker (MessageBrokerRegistry config ) {
1519 // Habilitar el broker solo para el canal /oidc
@@ -19,7 +23,9 @@ public void configureMessageBroker(MessageBrokerRegistry config) {
1923 @ Override
2024 public void registerStompEndpoints (StompEndpointRegistry registry ) {
2125 // Registrar el endpoint de WebSocket para que los clientes se conecten
22- registry .addEndpoint ("/qr-socket" ).withSockJS ();
26+ registry .addEndpoint ("/qr-socket" )
27+ .setAllowedOrigins (backendConfig .getUrl ())
28+ .withSockJS ();
2329 }
2430
2531}
You can’t perform that action at this time.
0 commit comments