-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat-be: 이메일 인증 후, 회원가입 이메일의 인증 여부 확인 (#882)
Co-authored-by: Kwoun Ki Ho <fingercut3822@gmail.com>
- Loading branch information
Showing
8 changed files
with
146 additions
and
5 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
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/com/cruru/email/exception/NotVerifiedEmailException.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,13 @@ | ||
package com.cruru.email.exception; | ||
|
||
import com.cruru.advice.UnauthorizedException; | ||
|
||
public class NotVerifiedEmailException extends UnauthorizedException { | ||
|
||
private static final String MESSAGE = "이메일 인증이 필요합니다."; | ||
|
||
public NotVerifiedEmailException() { | ||
super(MESSAGE); | ||
} | ||
} | ||
|
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
29 changes: 29 additions & 0 deletions
29
backend/src/main/java/com/cruru/email/service/VerificationStatus.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,29 @@ | ||
package com.cruru.email.service; | ||
|
||
import java.util.Arrays; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum VerificationStatus { | ||
|
||
VERIFIED("verified"), | ||
NOT_VERIFIED("not_verified"), | ||
; | ||
|
||
private final String value; | ||
|
||
VerificationStatus(String value) { | ||
this.value = value; | ||
} | ||
|
||
public static VerificationStatus fromValue(String value) { | ||
return Arrays.stream(VerificationStatus.values()) | ||
.filter(status -> status.getValue().equalsIgnoreCase(value)) | ||
.findFirst() | ||
.orElse(NOT_VERIFIED); | ||
} | ||
|
||
public boolean isVerified() { | ||
return this == VERIFIED; | ||
} | ||
} |
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