-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: 요청의 인증 정보를 컨트롤러에서 원하는 형태로 받을 수 있도록 #171
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
86f4eec
refactor: manager, provider, userDetails 적용
nayonsoso 262f2a9
refactor: 패키지 이동
nayonsoso c5c692c
test: Authentication 테스트 작성
nayonsoso e017f67
test: userDetailsService 테스트 작성
nayonsoso 7362f1c
test: AuthenticationProvider 테스트 작성
nayonsoso c98c996
feat: 인증 정보를 객체로 바꾸는 resolver 구현
nayonsoso a47c9f5
test: resolver 테스트 작성
nayonsoso e064bed
refactor: 탈퇴한 사용자인지 검증 추가, 함수 분리
nayonsoso 9f1ed60
test: 탈퇴한 사용자 검증 테스트 작성
nayonsoso 7bc4f83
style: 불필요한 개행 삭제
nayonsoso 23073a8
Merge remote-tracking branch 'origin/main' into refactor/add-authenti…
nayonsoso 215f9fa
refactor: 리졸버 이름 변경
nayonsoso c48b412
feat: 리졸버 활성화
nayonsoso 7a43316
Merge remote-tracking branch 'origin/main' into refactor/add-authenti…
nayonsoso c7160fb
refactor: 지원서 관련 코드에 리졸버 적용
nayonsoso 69d5408
refactor: 인증 관련 코드에 리졸버 적용
nayonsoso 7c27acf
refactor: 댓글 관련 코드에 리졸버 적용
nayonsoso 4c0c0f1
refactor: 사용자 관련 코드에 리졸버 적용
nayonsoso 9b34811
refactor: 게시글 관련 코드에 리졸버 적용
nayonsoso 65932d6
refactor: 대학 관련 코드에 리졸버 적용
nayonsoso e182af4
refactor: 성적 관련 코드에 리졸버 적용
nayonsoso 7865789
refactor: S3 관련 코드에 리졸버 적용
nayonsoso 5a0b99e
test: 사용자와 성적이 양방향 관계가 되도록 수정
nayonsoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
|
|
||
| import com.example.solidconnection.auth.domain.TokenType; | ||
| import com.example.solidconnection.config.security.JwtProperties; | ||
| import com.example.solidconnection.siteuser.domain.SiteUser; | ||
| import io.jsonwebtoken.Claims; | ||
| import io.jsonwebtoken.Jwts; | ||
| import io.jsonwebtoken.SignatureAlgorithm; | ||
|
|
@@ -12,8 +13,8 @@ | |
| import java.util.Date; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import static com.example.solidconnection.util.JwtUtils.parseSubjectIgnoringExpiration; | ||
| import static com.example.solidconnection.util.JwtUtils.parseSubject; | ||
| import static com.example.solidconnection.util.JwtUtils.parseSubjectIgnoringExpiration; | ||
|
|
||
| @RequiredArgsConstructor | ||
| @Component | ||
|
|
@@ -22,8 +23,13 @@ public class TokenProvider { | |
| private final RedisTemplate<String, String> redisTemplate; | ||
| private final JwtProperties jwtProperties; | ||
|
|
||
| public String generateToken(String email, TokenType tokenType) { | ||
| Claims claims = Jwts.claims().setSubject(email); | ||
| public String generateToken(SiteUser siteUser, TokenType tokenType) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오버로딩을 하신건 아직 email을 사용하는 로직이 남아있어서 그런건가요?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아뇨 가입 시 발급하는 토큰을 만들 때, String을 인자로 받아서 그랬습니다. 이 부분 헷갈릴 수 있으니 분리하는게 좋겠네요! 짚어주셔서 감사합니다😊 |
||
| String subject = siteUser.getId().toString(); | ||
| return generateToken(subject, tokenType); | ||
| } | ||
|
|
||
| public String generateToken(String string, TokenType tokenType) { | ||
| Claims claims = Jwts.claims().setSubject(string); | ||
| Date now = new Date(); | ||
| Date expiredDate = new Date(now.getTime() + tokenType.getExpireTime()); | ||
| return Jwts.builder() | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 PR에서는 SignUpService 나 SignInService 같은 코드들을 가입의 종류가 다양하도록 바꾸진 않았어요.
그래서 일단 카카오 인증만 다루면서 함수 이름이 signUp인 등.. 만족스럽지 않은 부분들이 있긴 한데,
이 부분은 다른 가입 방식을 추가하며 구현해보겠습니다.