From 8730d42aeb7064e61b3d1844a74343299556c9de Mon Sep 17 00:00:00 2001 From: baeksom <97323941+baeksom@users.noreply.github.com> Date: Sun, 26 May 2024 19:35:11 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[UPDATE]:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KGUcapstone/OutDecision/global/common/util/JwtUtil.java | 4 ++-- .../OutDecision/global/security/filter/JwtAuthFilter.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java b/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java index 6476026f..34efeb52 100644 --- a/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java +++ b/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java @@ -66,8 +66,8 @@ public String generateRefreshToken(String email, String role) { public String generateAccessToken(String email, String role) { -// long tokenPeriod = 1000L * 60L * 30L; // 30분 - long tokenPeriod = 1000L * 10L; + long tokenPeriod = 1000L * 60L * 30L; // 30분 + Claims claims = Jwts.claims().setSubject(email); claims.put("role", role); diff --git a/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java b/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java index 37106523..6c82d353 100644 --- a/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java +++ b/src/main/java/KGUcapstone/OutDecision/global/security/filter/JwtAuthFilter.java @@ -56,7 +56,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse String newAccessToken = tokenService.republishAccessToken(atc, response); if (newAccessToken != null) { - addCookie(response, "Authorization", newAccessToken, 60 * 5); + addCookie(response, "Authorization", newAccessToken, 60 * 60); atc = newAccessToken; log.info("토큰 발급 완료 필터 newAccessToken = {}", newAccessToken); } else { @@ -68,6 +68,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse // 아래 코드는 AccessToken이 유효할 때만 실행됨 if (jwtUtil.verifyToken(atc)) { + log.info("accessToken 유효 : " + atc); Member findMember = findMemberService.findByEmail(jwtUtil.getUid(atc)).orElse(null); if (findMember != null) { From f819048c042a1c0a0bbdae8d0e96f7ef6417f19f Mon Sep 17 00:00:00 2001 From: baeksom <97323941+baeksom@users.noreply.github.com> Date: Sun, 26 May 2024 19:36:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[UPDATE]:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=BF=A0=ED=82=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KGUcapstone/OutDecision/global/common/util/JwtUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java b/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java index 34efeb52..6476026f 100644 --- a/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java +++ b/src/main/java/KGUcapstone/OutDecision/global/common/util/JwtUtil.java @@ -66,8 +66,8 @@ public String generateRefreshToken(String email, String role) { public String generateAccessToken(String email, String role) { - long tokenPeriod = 1000L * 60L * 30L; // 30분 - +// long tokenPeriod = 1000L * 60L * 30L; // 30분 + long tokenPeriod = 1000L * 10L; Claims claims = Jwts.claims().setSubject(email); claims.put("role", role);