-
Notifications
You must be signed in to change notification settings - Fork 6
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
[BE] 일반 로그인을 구현한다. #775
Merged
Merged
[BE] 일반 로그인을 구현한다. #775
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
bca3bf1
feat: user 필드 추가에 따른 sql 수정
shin-jisong b44cc92
feat(UserRepository): 이메일과 로그인 타입으로 조회 구현
shin-jisong 5cc7c23
feat(User): 비밀번호 불일치 확인 구현
shin-jisong c90960d
feat(PasswordEncoder): 비밀번호 암호화 구현
shin-jisong a790116
fix(UserRepository): findByEmailAndLoginType 쿼리문 오류 수정
shin-jisong 22b26c2
feat(AuthService): 로컬 로그인 구현
shin-jisong e488edc
feat(AuthController): 로컬 로그인 구현
shin-jisong 8a63fa9
style: 코드 재정렬
shin-jisong 38eac07
Merge branch 'refs/heads/dev-be' into feat/755-local-login
shin-jisong e680d8e
test: 충돌 해결
shin-jisong 0dc0147
Merge branch 'refs/heads/dev-be' into feat/755-local-login
shin-jisong 08b86b6
fix: 충돌 해결
shin-jisong 4419c2e
test: 깨진 테스트 수정
shin-jisong 5fa12f4
feat(AuthService): localLogin 수정 구현
shin-jisong 005aeb6
feat(ArticleRepository): 시간이 같을 경우, 아이디로 정렬
shin-jisong 4472507
feat(PasswordEncoder): 암호화 구현
shin-jisong 8f2dcd4
feat(ChecklistRepository): 시간이 같을 경우, id로 정렬
shin-jisong c37e5c1
feat(Password): isDifferent 구현
shin-jisong 2d1d5bc
feat(User): isDifferent 구현
shin-jisong 6dd181c
test: 깨지는 테스트 수정
shin-jisong b2da013
style: 코드 재정렬
shin-jisong 53e3204
style: oauth 명명 변경
shin-jisong bd4c012
style: 함수 순서 변경
shin-jisong fb3b2a1
feat(PasswordEncoder): 상수화
shin-jisong 7c465e3
feat(Password): 비어있을 시 null 처리
shin-jisong 3e717e4
feat(Password): null이 들어오면 예외 발생
shin-jisong b21c9af
feat(AuthController): 로그인 path 변경
shin-jisong 6859f83
test(AuthE2ETest): 로컬 로그인 path 변경
shin-jisong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
backend/bang-ggood/src/main/java/com/bang_ggood/auth/dto/request/LocalLoginRequestV1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.bang_ggood.auth.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record LocalLoginRequestV1(@NotBlank(message = "이메일이 존재하지 않습니다.") String email, | ||
@NotBlank(message = "비밀번호가 존재하지 않습니다.") String password) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/bang-ggood/src/main/java/com/bang_ggood/global/config/WebMvcConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
-- 비밀번호 : password1234 | ||
INSERT INTO users(name, email, password, user_type, login_type, created_at, modified_at, deleted) | ||
VALUES ('방방이', '[email protected]', 'xDNYKEJqE/36U0Dt3nXRMFPNEMEgjCYM7R/A4B29baOsv4KYQ9MGgcO3HUa11sNKCFb9ZXyYBqJqxNglvBzFvg==:7yejAszEpxBb7AyZNKvAqpmMEJiKFXIa8JKwAx3n4loB2DRcAC2pfwkgo/dzKzRvBX4RbrATWaIlPYrgAhbHZQ==', | ||
VALUES ('방방이', '[email protected]', | ||
'xDNYKEJqE/36U0Dt3nXRMFPNEMEgjCYM7R/A4B29baOsv4KYQ9MGgcO3HUa11sNKCFb9ZXyYBqJqxNglvBzFvg==:7yejAszEpxBb7AyZNKvAqpmMEJiKFXIa8JKwAx3n4loB2DRcAC2pfwkgo/dzKzRvBX4RbrATWaIlPYrgAhbHZQ==', | ||
'USER', 'LOCAL', '2024-07-22 07:56:42', '2024-07-22 07:56:42', false); | ||
|
||
INSERT INTO custom_checklist_question(user_id, question, created_at, modified_at, deleted) | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금까지는 검증 메서드를 validate라고 했던 것 같아서 제안드려봅니다~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 부분은 정책에 따라 규칙에 맞는가 확인하는 것이 아닌 맞는가 체크하는 부분이라 생각해서 validate 명명보다는 비즈니스 로직 명명을 가질 수 있도록 구현하였습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 이해한 바에 따르면, 단순히 비밀번호가 다른지 체크하는 부분은 정책적인 부분이 아니라 네이밍을 다르게 가져가고 싶다는 의미로 이해했어요! 하지만 null, empty 체크도 비슷한 경우라고 생각되는데 validate 메서드명을 사용했던 것 같아서 이 부분은 어떻게 생각하는지 궁금합니다 ~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null 혹은 empty 체크는 값 자체의 형식에 대한 검증이라 생각해요!
validate 검증 로직은 주로 입력 데이터가 특정 형식, 패턴 또는 규칙에 부합하는지 확인 등 비즈니스 로직을 시작하기 직전에 값을 선별하는 데 사용하는 명명에 가깝다고 생각해요
예를 들어 저장한다는 비즈니스 로직 전 해당 값을 저장하기에 유효한지 검증하는 validate 검증 로직을 작성하는 것처럼요 🤔
반면에 비밀번호 일치 여부를 확인하는 로직은 단순히 입력 데이터의 형식 검증이 아닌, 기존 데이터와 비교하여 중요한 비즈니스 결정을 내리는 과정이라 생각했어요!
validate라는 검증의 의미만 담기에는 다소 의미가 축소되는 느낌이 있다고 판단하였습니다