Skip to content

Commit 06fc7ab

Browse files
authored
fix: 테스트 UI 문제 리스트 안 나오는 현상 수정 (#171)
* fix: 테스트 UI 문제 리스트 안 나오는 현상 수정 * refactor: 비 로그인 제출 요청 방어 로직 추가
1 parent 02f4b3f commit 06fc7ab

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ public class SubmissionService {
5656
private final GitHubPushService gitHubPushService;
5757

5858
public SubmitResponse prepareSubmission(Long problemId, AuthUser authUser) {
59+
60+
if (authUser == null) {
61+
throw new SubmissionException(SubmissionExceptionCode.AUTH_REQUIRED);
62+
}
63+
5964
boolean acquired = lockManager.tryLock("submission", authUser.getId(), problemId);
6065
if (!acquired) {
6166
throw new SubmissionException(SubmissionExceptionCode.ALREADY_JUDGING);

src/main/java/org/ezcode/codetest/common/security/util/SecurityPath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class SecurityPath {
1717
"/actuator/**",
1818
"/chatting",
1919
"/submit-test/**",
20-
"/problems/**",
20+
"/api/problems/**",
2121
"/ws/**",
2222
"/swagger-ui/**",
2323
"/swagger-resources/**",

src/main/java/org/ezcode/codetest/domain/submission/exception/code/SubmissionExceptionCode.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public enum SubmissionExceptionCode implements ResponseCode {
1717
TESTCASE_TIMEOUT(false, HttpStatus.GATEWAY_TIMEOUT, "테스트케이스 채점 시간이 초과되었습니다."),
1818
REDIS_SERVER_ERROR(false, HttpStatus.INTERNAL_SERVER_ERROR, "Redis 서버 연결 실패"),
1919
ALREADY_JUDGING(false, HttpStatus.CONFLICT, "이미 해당 문제에 대한 채점이 진행 중입니다."),
20+
AUTH_REQUIRED(false, HttpStatus.UNAUTHORIZED, "로그인 후 이용해주세요."),
2021
UNKNOWN_ERROR(false, HttpStatus.INTERNAL_SERVER_ERROR, "알 수 없는 예외가 발생했습니다."),
2122
;
2223
private final boolean success;

0 commit comments

Comments
 (0)