Skip to content

Conversation

@hado0123
Copy link
Collaborator

작업 내용

  • JWT 기반 로그인 인증 기능 구현
  • Access Token 발급 기능 추가
  • 비밀번호 검증 로직 구현
  • 관련 설정(Security, Filter) 적용

테스트 내용

  • Postman 로그인 요청 성공 확인
  • 유효하지 않은 비밀번호 시 예외 반환 확인
  • 토큰 포함 요청 시 정상 인증 여부 확인
  • 유효하지 않은 토큰, 유효기간이 지난 토큰 예외 반환 확인

추가 필요

  • Refresh Token 도입 및 재발급 로직 구현 예정
  • 로그인 성공 응답 DTO 정리 필요

@hado0123 hado0123 self-assigned this Nov 25, 2025
Copy link

@f-lab-saponin f-lab-saponin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다👍 리뷰한번 확인부탁드려요!

README.md Outdated
Comment on lines 37 to 50
### 🔹 방법 1) Docker MySQL + IDE(인텔리제이) 앱 실행

MySQL만 Docker로 실행하고, Spring Boot 앱은 IDE에서 실행하는 방식입니다.

```bash
docker compose up -d mysql
```

### 🔹 방법 2) Docker MySQL + Docker Spring Boot 앱 실행 (전체 Docker 실행)

MySQL과 Spring Boot 앱을 모두 Docker로 실행하는 방식입니다.
```bash
docker compose up -d mysql
docker compose up -d --build

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하나로 정해서 정리하면 좋아보여요🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하나로 정리 완료했습니다!

Comment on lines +12 to +13
// CREATOR는 MEMBER 권한 + CREATOR 권한을 모두 가진다
CREATOR(Set.of("ROLE_MEMBER", "ROLE_CREATOR"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 24 to 25
@PostMapping("/make")
public ResponseEntity<Map<String, String>> makeToken(@RequestBody LoginRequest loginRequest) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

하는 일이 로그인 같은데 "/login" 해도 될것같아요 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변경 완료했습니다!

Comment on lines 25 to 32
@Column(nullable = false, unique = true)
private String email;

@Column(nullable = false)
private String password;

@Column(nullable = false, length = 150)
private String name;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unique 는 고민해보시고
LoginRequest 에 있는 검증처럼 length 도 DB 타입에 넣어놓으면 좋을것같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email, password 각각 DTO에 맞춰 length추가 완료했습니다!

import java.util.Optional;

public interface MemberRepository extends JpaRepository<Member, Long> {
Optional<Member> findByEmail(String email);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INDEX 생성하셨다면 DDL 관리를위해 이것도 ddl 파일에 기록해주세요!

@Component
@Slf4j
public class JWTUtil {
private final SecretKey secretKey;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessToken 과 refreshToken 의 secretKey 는 다르게 하는게 보안을 더 향상할 수 있는 방법이예요.
어떻게 만들면 좋을지 고민해보면 좋겠습니다. 🙂

Copy link
Collaborator Author

@hado0123 hado0123 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secretKey 분리 완료했습니다

088c826

Comment on lines +29 to +30
@Transactional
public MemberResponse signup(MemberRequest memberRequest) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Transactional 이 꼭 필요하면 넣으면 좋아보여요. 필요할까요?

Copy link
Collaborator Author

@hado0123 hado0123 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회원가입 쪽은 나중에 초기 캐시 적립이나 다른 작업들이 묶일 수도 있을 것 같아서 일단은 @Transactional 유지해뒀어요.
이렇게 해도 괜찮을까요?

Comment on lines +65 to +66
@Transactional
public void deleteMember(Long memberId) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기두요 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회원가입과 마찬가지로 삭제시 같이 지워야 할 연관 데이터와 같은 다른 작업이 묶일수도 있다고 생각해서 일단 @Transactional 유지해 두었습니다.

Comment on lines 37 to 38
jwt:
secret: ${JWT_SECRET:1234567890123456789012345678901234567890}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secretKey 노출이 안되도록 해볼까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env 파일로 secretKey 및 DB 접속정보 처리했습니다

325ae16

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application.yaml + gitignore 조합도 추천합니다 🙂

import static org.assertj.core.api.Assertions.*;

@SpringBootTest
//@Transactional

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 의도하신걸까요? 데이터를 생성하고 다시 삭제하는걸 의도하셨다면 유지해야할 것 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잠깐 DB 데이터 확인 후 주석을 푼다는 걸 깜빡했네요! 원래대로 돌려놨습니다

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2025

Copy link

@f-lab-saponin f-lab-saponin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 반영해주시느라 고생하셨습니다 승인드립니다. 🙂
추가 코멘트 드린 부분 + Transactional 부분은 선택이니 고민해보시고 반영부탁드려요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants