Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] jwt principal 추가 #111

Merged
merged 4 commits into from
Aug 9, 2023
Merged

Conversation

tjdqls1200
Copy link
Collaborator

Issues

What is this PR? 👓

  • JWT Principal 추가

Key changes 🔑

  • JWT Claims username(loginId) 추가
  • 유저 인증 정보 Principal 추가

To reviewers 👋

  • JwtProvider createToken()이 payload 변경에 따라 영향을 받지 않도록 Map으로 수정했습니다.
  • Principal은 userId, loginId 두 정보가 모두 존재하지 않아도 null 생성되도록 했는데 수정할 부분 체크해주시면 반영하겠습니다..!

@tjdqls1200 tjdqls1200 added enhancement New feature or request back-end labels Aug 8, 2023
@tjdqls1200 tjdqls1200 added this to the [BE] Sprint #3 milestone Aug 8, 2023
@tjdqls1200 tjdqls1200 changed the title Be/feature/#109 jwt principal [BE] jwt principal 추가 Aug 8, 2023
Copy link

@23Yong 23Yong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다~!

@@ -15,6 +17,8 @@
@RequiredArgsConstructor
@Service
public class AuthService {
private static final String USER_ID = "userId";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

클래스와 필드 사이는 한 줄 띄어주세용~

public class AuthService {

    private static final String USER_ID = "userId";

@AllArgsConstructor
@NoArgsConstructor
public class Principal {
private static final String USER_ID = "userId";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 한 줄 띄어주세요~!

@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Principal {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정적 팩터리 메서드를 생성했는데 @AllArgsConstructor, @NoArgsConstructor를 달아주신 이유가 있나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 수정하겠습니다! 감사합니다

Copy link

@pie2457 pie2457 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍🏼👍🏼👍🏼

@@ -15,6 +17,8 @@
@RequiredArgsConstructor
@Service
public class AuthService {
private static final String USER_ID = "userId";
private static final String LOGIN_ID = "loginId";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요기 상수 처리는 앞으로를 위한건가요!? 지금은 한군데씩 밖에 사용을 안하는거죠?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵! 문자열은 보통 상수 처리하는 편입니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문자열이랑 상수 이름이 같아서 제거했습니다!

@tjdqls1200 tjdqls1200 merged commit 59c3a88 into be-w3 Aug 9, 2023
1 check passed
@tjdqls1200 tjdqls1200 deleted the be/feature/#109-jwt-principal branch August 9, 2023 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants