[HIMIN-232] refactor: 회원 비밀번호 검증 후 비번 암호화 #117
Merged
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.
PR 확인 항목
PR 보내기전에 아래 항목들을 만족 하였는지 체크 해주세요
PR 종류
어떤 종류의 PR인지 아래 항목중에 체크 해주세요
어떤 기능이 추가 되었나요?
이전에는 서비스단에서 비밀번호를 암호화한 값을 Member에 넘겨주었습니다. 하지만 이 방식에 문제가 있다는 것을 발견했습니다. 바로 비밀번호 길이에 대한 검증을 제외한 나머지 검증을 하지 못한다는 것이었습니다.
실제로 bcrypt 생성 사이트에서 실험해본 결과, 아무것도 입력하지 않을 때와 공백이 입력될 때 모두 bcrypt로 암호화되었습니다. 이 말은 공백에 대해서는 검증을 하지 못한다는 말입니다.
그래서
Member.passwor(...)
라는 정적 메서드를 만들었습니다. 이 메서드에서 비밀번호를 검증하고 통과한다면 암호화된 비밀번호를 반환하도록 하여, 회원 생성과 업데이트 시 해당 메서드를 사용하도록 변경하였습니다.Issue Number: HIMIN-232
기존에 있던 기능에 영향을 주나요?
기타