-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 문제 상황 - 이메일 인증코드 검증 후 이메일 인증 내역을 저장 - 이메일 인증 내역은 회원가입 및 이메일 변경이 완료될 때까지 남아있음 - 이메일 인증 내역이 남아있는 동안 다른 사용자가 동일한 이메일로 회원가입 및 이메일 변경 요청 시, 기존의 이메일 인증 내역을 통해 이메일 인증이 무단으로 통과됨 - 기존에 정상적으로 이메일 인증을 진행한 사용자는 이메일이 탈취되는 문제가 발생 - 문제 해결 : 이메일 인증 방식 변경 - before - 인증코드 검증 후 이메일 인증 성공 내역 저장 - 회원가입 및 이메일 변경 요청 시 이메일 인증 성공 내역이 존재하면 요청을 처리 - after - 인증코드 검증 후 검증 결과만 응답, 인증 내역 저장을 저장하지 않음 - 회원가입 및 이메일 변경 요청 시 인증코드를 재검증하여 성공 시 요청을 처리
- Loading branch information
Showing
34 changed files
with
716 additions
and
600 deletions.
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
24 changes: 10 additions & 14 deletions
24
src/main/java/com/alzzaipo/common/email/domain/EmailVerificationCode.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 |
---|---|---|
@@ -1,27 +1,23 @@ | ||
package com.alzzaipo.common.email.domain; | ||
|
||
import jakarta.validation.constraints.Pattern; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.hibernate.validator.constraints.Length; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class EmailVerificationCode { | ||
|
||
public static final int length = 8; | ||
public static final int length = 8; | ||
|
||
@Length(min = length, max = length) | ||
@Pattern(message = "이메일 형식 오류", regexp = "^[A-Za-z0-9]{8}$") | ||
private String emailVerificationCode; | ||
@Length(min = length, max = length) | ||
@Pattern(message = "이메일 형식 오류", regexp = "^[A-Za-z0-9]{8}$") | ||
private String emailVerificationCode; | ||
|
||
public EmailVerificationCode(String emailVerificationCode) { | ||
this.emailVerificationCode = emailVerificationCode; | ||
} | ||
public EmailVerificationCode(String emailVerificationCode) { | ||
this.emailVerificationCode = emailVerificationCode; | ||
} | ||
|
||
public String get() { | ||
return emailVerificationCode; | ||
} | ||
public String get() { | ||
return emailVerificationCode; | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
src/main/java/com/alzzaipo/common/email/domain/EmailVerificationStatus.java
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
.../java/com/alzzaipo/common/email/port/out/verification/CheckEmailVerificationCodePort.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,8 @@ | ||
package com.alzzaipo.common.email.port.out.verification; | ||
|
||
import com.alzzaipo.common.email.domain.EmailVerificationPurpose; | ||
|
||
public interface CheckEmailVerificationCodePort { | ||
|
||
boolean check(String email, String verificationCode, EmailVerificationPurpose purpose); | ||
} |
8 changes: 0 additions & 8 deletions
8
src/main/java/com/alzzaipo/common/email/port/out/verification/CheckEmailVerifiedPort.java
This file was deleted.
Oops, something went wrong.
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
8 changes: 0 additions & 8 deletions
8
...java/com/alzzaipo/common/email/port/out/verification/VerifyEmailVerificationCodePort.java
This file was deleted.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
...com/alzzaipo/member/adapter/in/web/dto/CheckLocalAccountEmailVerificationCodeRequest.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,21 @@ | ||
package com.alzzaipo.member.adapter.in.web.dto; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class CheckLocalAccountEmailVerificationCodeRequest { | ||
|
||
@NotBlank | ||
private String email; | ||
|
||
@NotBlank | ||
private String verificationCode; | ||
|
||
} |
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
8 changes: 8 additions & 0 deletions
8
...om/alzzaipo/member/application/port/in/account/local/CheckEmailVerificationCodeQuery.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,8 @@ | ||
package com.alzzaipo.member.application.port.in.account.local; | ||
|
||
import com.alzzaipo.member.application.port.in.dto.CheckLocalAccountEmailVerificationCodeCommand; | ||
|
||
public interface CheckEmailVerificationCodeQuery { | ||
|
||
boolean checkEmailVerificationCode(CheckLocalAccountEmailVerificationCodeCommand command); | ||
} |
Oops, something went wrong.