Skip to content

Commit 3b4c961

Browse files
committed
refactor: Modify JwtTokenProvider (#3)
1 parent 7047b07 commit 3b4c961

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

server-toy-project/src/main/java/com/gdsc_teamb/servertoyproject/jwt/JwtTokenProvider.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public JwtTokenProvider(@Value("${jwt.secret}") String secretKey) {
3030
}
3131

3232
// 유저 정보를 가지고 AccessToken, RefreshToken 생성
33-
public TokenInfo generateToken(Authentication authentication) {
33+
public JwtToken generateToken(Authentication authentication) {
3434
// 권한 가져오기
3535
String authorities = authentication.getAuthorities().stream()
3636
.map(GrantedAuthority::getAuthority)
@@ -54,7 +54,7 @@ public TokenInfo generateToken(Authentication authentication) {
5454
.signWith(key, SignatureAlgorithm.HS256)
5555
.compact();
5656

57-
return TokenInfo.builder()
57+
return JwtToken.builder()
5858
.grantType("Bearer")
5959
.accessToken(accessToken)
6060
.refreshToken(refreshToken)
@@ -98,7 +98,6 @@ public boolean validateToken(String token) {
9898
log.info("JWT 토큰이 잘못되었습니다.", e);
9999
}
100100
}
101-
102101
return false;
103102
}
104103

@@ -109,5 +108,4 @@ private Claims parseClaims(String accessToken) {
109108
return e.getClaims();
110109
}
111110
}
112-
113111
}

0 commit comments

Comments
 (0)