File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
backend/src/main/java/io/f1/backend/domain/game/websocket Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1313import io .f1 .backend .domain .game .dto .request .GameStartRequest ;
1414import io .f1 .backend .domain .user .dto .UserPrincipal ;
1515
16+ import java .security .Principal ;
1617import lombok .RequiredArgsConstructor ;
1718
1819import org .springframework .messaging .Message ;
1920import org .springframework .messaging .handler .annotation .DestinationVariable ;
2021import org .springframework .messaging .handler .annotation .MessageMapping ;
2122import org .springframework .messaging .simp .stomp .StompHeaderAccessor ;
23+ import org .springframework .security .core .Authentication ;
2224import org .springframework .stereotype .Controller ;
2325
2426@ Controller
@@ -117,6 +119,7 @@ private static String getSessionId(Message<?> message) {
117119
118120 private static UserPrincipal getSessionUser (Message <?> message ) {
119121 StompHeaderAccessor accessor = StompHeaderAccessor .wrap (message );
120- return (UserPrincipal ) accessor .getUser ();
122+ Authentication auth = (Authentication ) accessor .getUser ();
123+ return (UserPrincipal ) auth .getPrincipal ();
121124 }
122125}
You can’t perform that action at this time.
0 commit comments