Skip to content

Commit 6ce268b

Browse files
authored
Merge pull request #48 from Parkjyun/fix/47
[fix] 토론 세부 조회 비로그인 상태에서도 응답되도록 수정
2 parents 88d43cc + e133a5e commit 6ce268b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/com/newsnack/www/newsnackserver/security/config/SecurityConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
4040
authorizationManagerRequestMatcherRegistry
4141
.requestMatchers(Constants.AUTH_WHITELIST).permitAll()//whitelist는 인증없이
4242
.requestMatchers(HttpMethod.GET ,"/v1/articles/{articleId:\\d+}", "/v1/articles/main", "/v1/articles").permitAll()
43-
.requestMatchers("v1/debates/{debateId}", "/v1/debates", "/v1/debates/main").permitAll()
43+
.requestMatchers("/v1/debates/{debateId}", "/v1/debates", "/v1/debates/main").permitAll()
4444
.requestMatchers(HttpMethod.GET, "/v1/articles/{articleId}/comments").permitAll()
4545
.requestMatchers(HttpMethod.GET, "/v1/debates/{debateId}/comments").permitAll()
4646
.anyRequest().authenticated())//인증 필요

src/main/java/com/newsnack/www/newsnackserver/service/DebateService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ public DebateMainPageResponse getMainDebate() {
3434

3535
public DebateIndividualResponse getDebate(Long debateId, Long memberId) {
3636
Debate debate = debateJpaRepository.findDebateWithArticleJPQL(debateId).orElseThrow(() -> new DebateException(DebateFailureCode.DEBATE_NOT_FOUND));
37-
Member member = memberJpaRepository.getReferenceById(memberId);
3837
if (memberId == null) {//access 없다면
3938
return DebateIndividualResponse.of(debate, null);
4039
}
40+
Member member = memberJpaRepository.getReferenceById(memberId);
41+
4142
DebateParticipation debateParticipation;
4243
try {
4344
debateParticipation = debateParticipationJpaRepository.findByDebateAndMember(debate, member).get();

0 commit comments

Comments
 (0)