Skip to content

Commit bbaad1d

Browse files
committed
refactor: 코드 리뷰 반영
- from에서 of로 변경
1 parent 5cbb38b commit bbaad1d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/main/java/com/somemore/global/auth/authentication/JwtAuthenticationToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ public Object getPrincipal() {
3535
return principal;
3636
}
3737

38-
public static JwtAuthenticationToken from(User user, EncodedToken accessToken) {
38+
public static JwtAuthenticationToken of(User user, EncodedToken accessToken) {
3939
return new JwtAuthenticationToken(
4040
user.getId(),
4141
accessToken,
4242
List.of(new SimpleGrantedAuthority(user.getRole().getAuthority()))
4343
);
4444
}
4545

46-
public static JwtAuthenticationToken from(String userId, String role, EncodedToken accessToken) {
46+
public static JwtAuthenticationToken of(String userId, String role, EncodedToken accessToken) {
4747
return new JwtAuthenticationToken(
4848
userId,
4949
accessToken,

src/main/java/com/somemore/global/auth/idpw/provider/CustomAuthenticationProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
3636

3737
EncodedToken accessToken = generateAccessToken(user);
3838

39-
return JwtAuthenticationToken.from(user, accessToken);
39+
return JwtAuthenticationToken.of(user, accessToken);
4040
}
4141

4242
@Override

src/main/java/com/somemore/global/auth/jwt/filter/JwtAuthFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@ private JwtAuthenticationToken createAuthenticationToken(Claims claims,
9999
String userId = claims.get("id", String.class);
100100
String role = claims.get("role", String.class);
101101

102-
return JwtAuthenticationToken.from(userId, role, accessToken);
102+
return JwtAuthenticationToken.of(userId, role, accessToken);
103103
}
104104
}

0 commit comments

Comments
 (0)