Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 로그인 기능 구현 #25

Open
6 tasks done
songhee1 opened this issue Feb 4, 2025 · 0 comments · Fixed by #27, #26 or #28
Open
6 tasks done

[feat] 로그인 기능 구현 #25

songhee1 opened this issue Feb 4, 2025 · 0 comments · Fixed by #27, #26 or #28
Assignees

Comments

@songhee1
Copy link
Collaborator

songhee1 commented Feb 4, 2025

🟥 구현 기능

회원가입이 완료된 이메일과 비밀번호를 가지고 로그인을 처리한다.

🟥 구현할 세부 내용

  • JWT 라이브러리 추가 및 JWT 응답 DTO 구성
  • JWT TokenProvider 구현 - accessToken과 refreshToken을 생성
  • JWT AuthenticationFilter 구현
  • SecurityConfig 구현 - 인증처리를 진행할 uri와 그렇지 않을 uri를 구분하고 csrf 설정
  • 로그인 인증을 위한 Service 추가
  • 포스트맨 테스트

🟥 참고해야할 점

@songhee1 songhee1 self-assigned this Feb 4, 2025
songhee1 added a commit to songhee1/S-Market-project that referenced this issue Feb 11, 2025
- lettuceConnectionFactory 매개변수로 redisProperties 사용하도록 수정
- org.springframework.data 대신 org.springframework.boot에 있는 redis를 사용하도록 수정
songhee1 added a commit to songhee1/S-Market-project that referenced this issue Feb 11, 2025
- JwtTokenProvider : 한꺼번에 액세스토큰과 리프레시 토큰을 발급하는 것이 아닌 각각 따로 발급할 수 있도록 메서드 분리
- JwtTokenResponseDTO : 액세스 토큰없이 리프레시 토큰만으로는 Authentication을 확인할 방법이 없으므로 재발급 요청시 액세스 토큰과 리프레시 토큰을 받도록 수정
- JwtTokenResponseDTO : accessToken의 만료시간(남은 시간), 리프레시 토큰의 만료시간(남은 시간)도 함께 확인할 수 있도록 추가
- MemberController : 액세스 토큰 재발급 api를 위한 컨트롤러 추가
- MemberService :
  login() - 리프레시 토큰, 액세스 토큰 모두 레디스에 저장 및 TTL 설정
  reissueToken() - 액세스 토큰 만료시, 리프레시 토큰 검증 후 액세스 토큰만 새로 발급하도록 하여 레디스에 새로 등록
songhee1 added a commit to songhee1/S-Market-project that referenced this issue Feb 11, 2025
- CustomException : getMessage() - 서버에서 전달받고자하는 메세지를 반환하도록 수정
- ErrorCode : externalMessage, internalMessage 추가, 기존 ErrorCode 요소에 추가된 internalMessage는 ""로 일단 통일
- GlobalExceptionHandler : 클라이언트에게 어떤 메세지와 로그를 출력할지 다시 고민
@songhee1 songhee1 linked a pull request Feb 11, 2025 that will close this issue
songhee1 added a commit that referenced this issue Feb 11, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[#25] 로그인 api 구현
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment