22
33import com .asyncgate .signaling_server .security .constant .Constants ;
44import com .asyncgate .signaling_server .security .utility .JsonWebTokenUtil ;
5- import com .asyncgate .signaling_server .signaling .KurentoManager ;
65import io .jsonwebtoken .Claims ;
76import org .slf4j .Logger ;
87import org .slf4j .LoggerFactory ;
9- import org .springframework .context .annotation .Lazy ;
108import org .springframework .http .HttpStatus ;
119import org .springframework .messaging .Message ;
1210import org .springframework .messaging .MessageChannel ;
@@ -21,17 +19,11 @@ public class FilterChannelInterceptor implements ChannelInterceptor {
2119
2220 private static final Logger log = LoggerFactory .getLogger (FilterChannelInterceptor .class );
2321 private static final String AUTHORIZATION_HEADER = "Authorization" ;
24-
25- private static final String ROOM_HEADER = "room-id" ;
2622 private static final String BEARER_PREFIX = "Bearer " ;
2723 private final JsonWebTokenUtil jsonWebTokenUtil ;
2824
29- @ Lazy // ✅ Circular Dependency 방지
30- private final KurentoManager kurentoManager ;
31-
32- public FilterChannelInterceptor (JsonWebTokenUtil jsonWebTokenUtil , KurentoManager kurentoManager ) {
25+ public FilterChannelInterceptor (JsonWebTokenUtil jsonWebTokenUtil ) {
3326 this .jsonWebTokenUtil = jsonWebTokenUtil ;
34- this .kurentoManager = kurentoManager ;
3527 }
3628
3729 private String extractToken (String headerValue ) {
@@ -59,18 +51,8 @@ public Message<?> preSend(Message<?> message, MessageChannel channel) {
5951 if (headerAccessor .getSessionAttributes ().get ("userId" ) == null ) {
6052 throw new ResponseStatusException (HttpStatus .UNAUTHORIZED , "userId is missing" );
6153 }
62-
63- // ✅ roomId 가져오기
64- String roomId = headerAccessor .getFirstNativeHeader (ROOM_HEADER );
65- log .info ("🔑 [STOMP] Room ID: {}" , roomId );
66- if (roomId == null || roomId .isEmpty ()) {
67- log .error ("🚨 [STOMP] Room ID is missing!" );
68- throw new ResponseStatusException (HttpStatus .BAD_REQUEST , "Room ID is missing" );
69- }
70-
71- log .info ("✅ [STOMP] CONNECT 요청 처리 완료 - Room ID: {}" , roomId );
72-
73- kurentoManager .getUsersInChannel (roomId );
54+
55+ log .info ("✅ [STOMP] CONNECT 요청 처리 완료" );
7456 }
7557 return message ;
7658 }
0 commit comments