Skip to content

Commit

Permalink
feat: 토큰 Subject에 식별자 추가
Browse files Browse the repository at this point in the history
- 하위 호환성을 지키기 위해 기존 방식은 유지
  • Loading branch information
seokjin8678 committed May 22, 2024
1 parent bafe152 commit ebd3ce7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class AdminAuthenticationTokenProvider {
public TokenResponse provide(AdminAuthentication adminAuthentication) {
return tokenProviderTemplate.provide(EXPIRATION_MINUTES,
jwtBuilder -> jwtBuilder
.subject(adminAuthentication.getId().toString())
.claim(ADMIN_ID_KEY, adminAuthentication.getId())
.audience().add(Role.ADMIN.name()).and()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class MemberAuthenticationTokenProvider {
public TokenResponse provide(MemberAuthentication memberAuthentication) {
return tokenProviderTemplate.provide(EXPIRATION_MINUTES,
jwtBuilder -> jwtBuilder
.subject(memberAuthentication.getId().toString())
.claim(MEMBER_ID_KEY, memberAuthentication.getId())
.audience().add(Role.MEMBER.name()).and()
);
Expand Down

0 comments on commit ebd3ce7

Please sign in to comment.