Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,10 @@ public void removeUser(final String roomId, final String userId) {
// 사용자 정보 제거
userStates.remove(userId);

// 사용자 제거 이벤트 브로드캐스트
log.info("유저가 방을 나가려고 합니다 ~~!!!!!! roomId={}, userId={}", roomId, userId);

// 예: 클라이언트 측에서 해당 사용자의 미디어 스트림 제거 처리를 수행하도록 알림 전송
messagingTemplate.convertAndSend("/topic/removed/" + roomId, userId);
messagingTemplate.convertAndSend("/topic/removed/" + roomId, new KurentoAnswerResponse("userId", userId));

// 선택사항: 방이 비어있다면 미디어 파이프라인도 정리
if (roomEndpoints.get(roomId).isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public class DefaultJsonWebTokenResponse {
@NotBlank
private final String userId;

@Schema(description = "유저 Nickname", example = "idididid")
@JsonProperty("nickname")
@NotBlank
private final String nickname;

@Schema(description = "JWT 토큰", example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
@JsonProperty("access_token")
@NotBlank
Expand All @@ -22,9 +27,11 @@ public class DefaultJsonWebTokenResponse {
@Builder
public DefaultJsonWebTokenResponse(
String userId,
String nickname,
String accessToken
) {
this.userId = userId;
this.nickname = nickname;
this.accessToken = accessToken;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public void afterPropertiesSet() {
}

// token 생성 메서드
public DefaultJsonWebTokenResponse generate(final String id) {
public DefaultJsonWebTokenResponse generate(final String id, final String nickname) {
return new DefaultJsonWebTokenResponse(
id,
nickname,
generateJwt(id, accessTokenExpirePeriod)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public DefaultJsonWebTokenResponse execute(final LoginMemberRequest request) {
throw new UserServerException(FailType._INVALID_PASSWORD);
}

DefaultJsonWebTokenResponse response = jsonWebTokenUtil.generate(member.getId());
DefaultJsonWebTokenResponse response = jsonWebTokenUtil.generate(member.getId(), member.getNickname());
log.info(response.getAccessToken());

return response;
Expand Down
Loading