Skip to content

[feat] 로그인 API#33

Merged
dtd1614 merged 8 commits intodevfrom
K5P-44/feat/인증-인가-API
Jul 9, 2024

Hidden character warning

The head ref may contain hidden characters: "K5P-44/feat/\uc778\uc99d-\uc778\uac00-API"
Merged

[feat] 로그인 API#33
dtd1614 merged 8 commits intodevfrom
K5P-44/feat/인증-인가-API

Conversation

@dtd1614
Copy link
Copy Markdown
Member

@dtd1614 dtd1614 commented Jul 9, 2024

관련 이슈

구현 기능

  • 로그인 API 구현
  • 로그인 API 테스트
  • 로그인 서비스 함수 테스트
  • 로그인 성공 시 액세스 토큰과 리프레시 토큰을 쿠키로 발급
  • 리프레시 토큰 레디스에 저장

참고 사항

  • javascript로 로그인 API 요청 시 credentials: 'include' 설정해야 쿠키 발급됨

@dtd1614 dtd1614 added the feat 기능 개발 label Jul 9, 2024
@dtd1614 dtd1614 self-assigned this Jul 9, 2024
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jul 9, 2024

@dtd1614 dtd1614 merged commit 9c090b1 into dev Jul 9, 2024
@Override
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
User user = userRepository.findByEmail(email)
.orElseThrow(() -> new GlobalException(FailureInfo.NOT_EXIST_USER));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

UsernameNotFoundException를 throw하는 곳이 없지 않나요?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

실수한 것 같습니다 수정하겠습니다!

@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@SQLDelete(sql = "UPDATE contract SET is_deleted = true WHERE id = ?")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

삭제처리라는 메서드를 업데이트로 하게끔 구성해도 될 것 같은데,
DB에서 삭제처리가 될 때 @SQLDelete로 DML문을 바꾸는 장점이 뭔지 궁금하네요

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

이 엔티티는 soft delete가 기본이라는 것을 개발자에게 명시하고
개발자가 실수로 hard delete를 하는 경우를 방지하고자 했습니다.
기본적으로 soft delete이지만 hard delete가 필요한 경우에는 repository 함수에 @query와 JPQL을 사용해서 직접 delete 쿼리를 발생시킬 생각입니다.

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

Labels

feat 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants