Skip to content

Commit

Permalink
[#83] Refactor: 사용하지 않는 메소드 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
SY2on committed Jan 18, 2024
1 parent 3b127c8 commit ea1c25d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ public static Long getLoginUserId() {
return loginUser != null ? loginUser.getId() : null;
}

/**
* 현재 로그인한 사용자가 userId가 아니면 AuthorizationServiceException 을 던진다.
*/
public static void checkUser(Long userId) throws AuthorizationServiceException {
if (!userId.equals(getLoginUserId())) {
throw new AuthorizationServiceException("UserId: " + userId + " 는 해당 영역에 접근할 수 없습니다.");
}
}
private static UserPrincipalDto toDto(Object principal) {
CustomUserDetails user = (CustomUserDetails) principal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,4 @@ public boolean validateToken(String token) throws BaseException{
return true;
}

// 토큰 만료 시간 확인(밀리세컨드)
public Long getExpiration(String accessToken) {
Date expiration = Jwts
.parserBuilder()
.setSigningKey(key)
.build()
.parseClaimsJws(accessToken)
.getBody()
.getExpiration();

Long now = new Date().getTime();

return (expiration.getTime() - now);
}







}

0 comments on commit ea1c25d

Please sign in to comment.