Skip to content

Commit

Permalink
refactor : token service에 id를 parsing 하는 getId 추가 (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-ho committed Mar 11, 2024
1 parent 6b75530 commit ad5bf95
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ public boolean validateTokenExpirationTimeNotExpired(String token) {
}
}

public String getUnivId(String token) {
return Jwts.parser()
public Long getId(String token) {
String subject = Jwts.parser()
.setSigningKey(secretHolder.getSecret())
.parseClaimsJws(token)
.getBody()
.getSubject();

// TODO : Exception Check
return Long.parseLong(subject);
}

private Token createToken(Claims claims, String roleKey) {
Expand Down

0 comments on commit ad5bf95

Please sign in to comment.