Skip to content

Commit

Permalink
[feat] 회원가입 유저아이디 암호화 #162
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJE20 committed May 31, 2023
1 parent c9e569d commit 8d0c397
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class SignupResponseDto {
private Long id;
private String id;
private String name;
private String nickname;

public static SignupResponseDto of(Long id, String name, String nickname) {
public static SignupResponseDto of(String id, String name, String nickname) {
SignupResponseDto responseDto = new SignupResponseDto();
responseDto.id = id;
responseDto.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import kr.co.wingle.common.exception.NotFoundException;
import kr.co.wingle.common.jwt.TokenInfo;
import kr.co.wingle.common.jwt.TokenProvider;
import kr.co.wingle.common.util.AES256Util;
import kr.co.wingle.common.util.RedisUtil;
import kr.co.wingle.common.util.S3Util;
import kr.co.wingle.common.util.SecurityUtil;
Expand Down Expand Up @@ -50,6 +51,7 @@
import kr.co.wingle.member.mailVo.CodeMail;
import kr.co.wingle.member.mailVo.RejectionMail;
import kr.co.wingle.profile.ProfileRepository;
import kr.co.wingle.profile.ProfileService;
import kr.co.wingle.profile.entity.Profile;
import lombok.RequiredArgsConstructor;

Expand All @@ -67,6 +69,8 @@ public class AuthService {
private final RedisUtil redisUtil;
private final MailService mailService;
private final MemberService memberService;
private final ProfileService profileService;
private final AES256Util aes;

@Transactional
public SignupResponseDto signup(SignupRequestDto request) {
Expand Down Expand Up @@ -95,7 +99,8 @@ public SignupResponseDto signup(SignupRequestDto request) {
request.getNation());
profileRepository.save(profile);

return SignupResponseDto.of(member.getId(), member.getName(), profile.getNickname());
// encrypt and return
return SignupResponseDto.of(aes.encrypt(member.getId().toString()), member.getName(), profile.getNickname());
}

@Transactional
Expand Down

0 comments on commit 8d0c397

Please sign in to comment.