From db6625a80786de2431d1c57e4ef538bc72698315 Mon Sep 17 00:00:00 2001 From: "Kim._.jazz" Date: Fri, 18 Oct 2024 16:55:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20check=20email=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=20=EC=9D=B4=EB=8F=99,=20jwt=ED=95=84?= =?UTF-8?q?=ED=84=B0=20=EC=88=98=EC=A0=95,=20config=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/sch/chekirout/auth/jwt/filter/JwtRequestFilter.java | 2 +- .../com/sch/chekirout/auth/presentation/AuthController.java | 5 ----- .../java/com/sch/chekirout/common/config/SecurityConfig.java | 4 ++-- .../com/sch/chekirout/email/controller/EmailController.java | 5 +++++ src/main/resources/application-db.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/sch/chekirout/auth/jwt/filter/JwtRequestFilter.java b/src/main/java/com/sch/chekirout/auth/jwt/filter/JwtRequestFilter.java index c6894d5..1e9e0be 100644 --- a/src/main/java/com/sch/chekirout/auth/jwt/filter/JwtRequestFilter.java +++ b/src/main/java/com/sch/chekirout/auth/jwt/filter/JwtRequestFilter.java @@ -38,7 +38,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse if (request.getRequestURI().equals("/api/v1/signup") || request.getRequestURI().equals("/api/v1/login") || request.getRequestURI().equals("/api/v1/auth/verify-email") || - request.getRequestURI().equals("/api/v1/checkEmail") || + request.getRequestURI().equals("/api/v1/auth/checkEmail") || request.getRequestURI().equals("/api/v1/auth/validate-email") ){ chain.doFilter(request, response); diff --git a/src/main/java/com/sch/chekirout/auth/presentation/AuthController.java b/src/main/java/com/sch/chekirout/auth/presentation/AuthController.java index 07b0d16..851ad24 100644 --- a/src/main/java/com/sch/chekirout/auth/presentation/AuthController.java +++ b/src/main/java/com/sch/chekirout/auth/presentation/AuthController.java @@ -60,12 +60,7 @@ public class AuthController { @Autowired private EmailVerificationTokenRepository emailVerificationTokenRepository; - @PostMapping("/checkEmail") - public void checkEmail(@RequestParam String email) { - // 이메일 인증 토큰 생성 및 이메일 발송 - emailService.sendVerificationEmail(email); - } @PostMapping("/signup") public ResponseEntity registerUser(@RequestBody @Valid UserRequest userRequest, BindingResult bindingResult, HttpServletRequest request ) { diff --git a/src/main/java/com/sch/chekirout/common/config/SecurityConfig.java b/src/main/java/com/sch/chekirout/common/config/SecurityConfig.java index 492ce49..eefae11 100644 --- a/src/main/java/com/sch/chekirout/common/config/SecurityConfig.java +++ b/src/main/java/com/sch/chekirout/common/config/SecurityConfig.java @@ -32,8 +32,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http, JwtRequestFilt authorize .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() .requestMatchers("/","/api/v1/signup", "/api/v1/login", - "/api/v1/users/validate-username", "/api/v1/users/validate-email", "/api/v1/checkEmail", - "/swagger-resources/**", "/swagger-ui/**","/swagger-ui/index.html", "/v3/api-docs/**", "/api/v1/auth/verify-email", "/api/v1/auth/validate-email").permitAll() + "/api/v1/users/validate-username", "/api/v1/users/validate-email", "/api/v1/auth/**", + "/swagger-resources/**", "/swagger-ui/**","/swagger-ui/index.html", "/v3/api-docs/**").permitAll() .requestMatchers("/api/v1/admin/users/{username}/role").hasRole("MASTER") .requestMatchers("/api/v1/admin/**" ).hasAnyRole("ADMIN", "MASTER") diff --git a/src/main/java/com/sch/chekirout/email/controller/EmailController.java b/src/main/java/com/sch/chekirout/email/controller/EmailController.java index 18940f1..162103b 100644 --- a/src/main/java/com/sch/chekirout/email/controller/EmailController.java +++ b/src/main/java/com/sch/chekirout/email/controller/EmailController.java @@ -19,7 +19,12 @@ public EmailController(EmailService emailService) { this.emailService = emailService; } + @PostMapping("/checkEmail") + public void checkEmail(@RequestParam String email) { + // 이메일 인증 토큰 생성 및 이메일 발송 + emailService.sendVerificationEmail(email); + } @GetMapping("/verify-email") public ResponseEntity verifyEmail(@RequestParam("token") String token) { diff --git a/src/main/resources/application-db.yml b/src/main/resources/application-db.yml index c94b669..f4a6cb9 100644 --- a/src/main/resources/application-db.yml +++ b/src/main/resources/application-db.yml @@ -38,7 +38,7 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/chekirout username: root - password: root1234 + password: rlawjdgns10! p6spy: enabled: true appender: com.p6spy.engine.spy.appender.Slf4JLogger