Skip to content

Commit

Permalink
[UPDATE]: 로그인 쿠키 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
baeksom committed May 26, 2024
1 parent 05872b9 commit 8730d42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down

0 comments on commit 8730d42

Please sign in to comment.