From 0c4f1f96e6cb8be46adebe8cbbdb6cdcf093630c Mon Sep 17 00:00:00 2001 From: LeeYuJoon Date: Fri, 11 Oct 2024 19:29:37 +0900 Subject: [PATCH] :bug: Implement Email Certification Related: #5 --- .../the_monitor/infrastructure/jwt/JwtProvider.java | 2 +- .../the_monitor/presentation/AccountController.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/the_monitor/infrastructure/jwt/JwtProvider.java b/src/main/java/the_monitor/infrastructure/jwt/JwtProvider.java index d376d64..d3ee826 100644 --- a/src/main/java/the_monitor/infrastructure/jwt/JwtProvider.java +++ b/src/main/java/the_monitor/infrastructure/jwt/JwtProvider.java @@ -33,7 +33,7 @@ public class JwtProvider { public JwtProvider(@Value("${jwt.secret_key}") String secretKey, @Value("${jwt.access_token_expire}") Long accessTokenExpire, @Value("${jwt.refresh_token_expire}") Long refreshTokenExpire) { - this.key = Keys.hmacShaKeyFor(Decoders.BASE64.decode(secretKey)); + this.key = Keys.secretKeyFor(SignatureAlgorithm.HS256); // 안전한 256비트 비밀 키 생성 this.ACCESS_TOKEN_EXPIRE_TIME = accessTokenExpire; this.REFRESH_TOKEN_EXPIRE_TIME = refreshTokenExpire; } diff --git a/src/main/java/the_monitor/presentation/AccountController.java b/src/main/java/the_monitor/presentation/AccountController.java index 57ad6d8..0e5ae61 100644 --- a/src/main/java/the_monitor/presentation/AccountController.java +++ b/src/main/java/the_monitor/presentation/AccountController.java @@ -30,11 +30,13 @@ public void verifyEmail(@RequestParam("certifiedKey") String certifiedKey, HttpS accountService.verifyEmail(certifiedKey, response); } - - @GetMapping("/sendVerificationEmail") - public ApiResponse sendVerificationEmail(@RequestParam("email") String email) { - return ApiResponse.onSuccess(accountService.sendVerificationEmail(email)); - } +// +// @GetMapping("/sendVerificationEmail") +// public ApiResponse sendVerificationEmail(@RequestParam("email") String email) { +// +// return ApiResponse.onSuccess(accountService.sendVerificationEmail(email)); +// +// }