-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from NARAE-FLIWITH/feat/logout
로그아웃, 이메일 인증 관련
- Loading branch information
Showing
23 changed files
with
320 additions
and
65 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
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,44 @@ | ||
package com.narae.fliwith.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.mail.javamail.JavaMailSender; | ||
import org.springframework.mail.javamail.JavaMailSenderImpl; | ||
|
||
import java.util.Properties; | ||
|
||
@Configuration | ||
public class MailConfig { | ||
@Value("${spring.mail.username}") | ||
private String id; | ||
@Value("${spring.mail.password}") | ||
private String password; | ||
@Value("${spring.mail.host}") | ||
private String host; | ||
@Value("${spring.mail.port}") | ||
private int port; | ||
|
||
@Bean | ||
public JavaMailSender javaMailService() { | ||
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl(); | ||
|
||
javaMailSender.setHost(host); | ||
javaMailSender.setUsername(id); | ||
javaMailSender.setPassword(password); | ||
javaMailSender.setPort(port); | ||
javaMailSender.setJavaMailProperties(getMailProperties()); | ||
javaMailSender.setDefaultEncoding("UTF-8"); | ||
return javaMailSender; | ||
} | ||
|
||
private Properties getMailProperties() { | ||
Properties properties = new Properties(); | ||
properties.setProperty("mail.transport.protocol", "smtp"); | ||
properties.setProperty("mail.smtp.auth", "true"); | ||
properties.setProperty("mail.smtp.starttls.enable", "true"); | ||
properties.setProperty("mail.debug", "true"); | ||
properties.setProperty("mail.smtp.ssl.trust","smtp.gmail.com"); | ||
return properties; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.narae.fliwith.domain; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum SignupStatus { | ||
COMPLETE, ING, FAIL | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/narae/fliwith/exception/user/AlreadyLogoutException.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,11 @@ | ||
package com.narae.fliwith.exception.user; | ||
|
||
import static com.narae.fliwith.exception.constants.UserExceptionList.ALREADY_LOGOUT_ERROR; | ||
|
||
public class AlreadyLogoutException extends UserException{ | ||
public AlreadyLogoutException(){ | ||
super(ALREADY_LOGOUT_ERROR.getErrorCode(), | ||
ALREADY_LOGOUT_ERROR.getHttpStatus(), | ||
ALREADY_LOGOUT_ERROR.getMessage()); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/narae/fliwith/exception/user/EmailAuthException.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,12 @@ | ||
package com.narae.fliwith.exception.user; | ||
|
||
import static com.narae.fliwith.exception.constants.UserExceptionList.EMAIL_AUTH_ERROR; | ||
|
||
public class EmailAuthException extends UserException{ | ||
public EmailAuthException(){ | ||
super(EMAIL_AUTH_ERROR.getErrorCode(), | ||
EMAIL_AUTH_ERROR.getHttpStatus(), | ||
EMAIL_AUTH_ERROR.getMessage()); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/narae/fliwith/exception/user/EmailSendException.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,11 @@ | ||
package com.narae.fliwith.exception.user; | ||
|
||
import static com.narae.fliwith.exception.constants.UserExceptionList.EMAIL_SEND_ERROR; | ||
|
||
public class EmailSendException extends UserException{ | ||
public EmailSendException(){ | ||
super(EMAIL_SEND_ERROR.getErrorCode(), | ||
EMAIL_SEND_ERROR.getHttpStatus(), | ||
EMAIL_SEND_ERROR.getMessage()); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/narae/fliwith/exception/user/RequireEmailAuthException.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,11 @@ | ||
package com.narae.fliwith.exception.user; | ||
|
||
import static com.narae.fliwith.exception.constants.UserExceptionList.REQUIRE_EMAIL_AUTH; | ||
|
||
public class RequireEmailAuthException extends UserException { | ||
public RequireEmailAuthException(){ | ||
super(REQUIRE_EMAIL_AUTH.getErrorCode(), | ||
REQUIRE_EMAIL_AUTH.getHttpStatus(), | ||
REQUIRE_EMAIL_AUTH.getMessage()); | ||
} | ||
} |
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
Oops, something went wrong.