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

✨ [Feat] 카카오 소셜 로그인 구현 #77

Merged
merged 32 commits into from
May 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
50b5db5
:sparkles: [Feat] JWT 핸들러 추가
88dldl Apr 30, 2024
755a26d
:sparkles: [Feat] 소셜타입 필드 추가
88dldl Apr 30, 2024
503ff8a
:sparkles: [Feat] 스프링 시큐리티 설정
88dldl Apr 30, 2024
623e8f9
:sparkles: [Feat] JWT,security 의존성 및 환경변수 추가
88dldl Apr 30, 2024
a21e051
:sparkles: [Feat] AUTH 관련 에러코드 추가
88dldl Apr 30, 2024
c98d713
:sparkles: [Feat] 유저 추출 커스텀 어노테이션
88dldl Apr 30, 2024
39c09de
:sparkles: [Feat] 리프레시 토큰 저장,삭제 및 유효성 확인
88dldl Apr 30, 2024
ffd8c77
:sparkles: [Feat] 유저 정보 확인
88dldl Apr 30, 2024
0485e34
:sparkles: [Feat] Jwt 생성 및 유효성 확인
88dldl Apr 30, 2024
4180f70
:sparkles: [Feat] 액세스토큰과 카카오 유저정보 가져오기
88dldl Apr 30, 2024
8a67f32
:recycle: [Refactor] 이미지 생성 메서드 삭제 및 컨벤션 적용
88dldl Apr 30, 2024
25f6893
:recycle: [Refactor] 컨벤션 적용
88dldl Apr 30, 2024
01e9116
:recycle: [Refactor] 컨벤션 적용
88dldl Apr 30, 2024
181316e
:sparkles: [Feat] 카카오 로그인 관련 API 생성
88dldl Apr 30, 2024
5daaa07
:recycle: [Refactor] 응답에 제네릭 타입 추가
88dldl Apr 30, 2024
d1e4b3c
Merge branch 'develop' of https://github.com/SSU-Plector/SSU-Plector-…
88dldl May 1, 2024
3e4bbb3
Merge branch 'develop' of https://github.com/SSU-Plector/SSU-Plector-…
88dldl May 6, 2024
f9c4263
:recycle: [Refactor] enum값 대문자 변경
88dldl May 7, 2024
30d5633
Merge branch 'develop' of https://github.com/SSU-Plector/SSU-Plector-…
88dldl May 7, 2024
fa19a3a
:recycle: [Refactor] 제네릭타입 추가 및 파라미터 이름 지정
88dldl May 7, 2024
9a1449a
:sparkles: [Feat] 로그인 테스트 코드 추가
88dldl May 7, 2024
0e7bd40
:recycle: [Refactor] 코드컨벤션 적용
88dldl May 7, 2024
1ae38c0
:recycle: [Refactor] body값 claimName변경
88dldl May 8, 2024
4dd8c7d
:recycle: [Refactor] 토큰 정보 인식되게 카멜케이스로 수정
88dldl May 8, 2024
c76a918
:sparkles: [Feat] JWT, 카카오 환경변수 추가
88dldl May 9, 2024
0074b58
:recycle: [Refactor] 토큰 재발급 요청시 파라미터로 리프레시 토큰 받기 -> 토큰 추출 방식으로 변경
88dldl May 9, 2024
109fcd3
:recycle: [Refactor] 요청값 이름변경
88dldl May 9, 2024
a7680dc
:sparkles: [Feat] 토큰 추출 어노테이션 추가
88dldl May 9, 2024
19d844e
:sparkles: [Feat] AuthException 처리 필터 추가
88dldl May 9, 2024
3a19fa3
:sparkles: [Feat] CORS 설정 추가
88dldl May 9, 2024
03ae06f
:sparkles: [Feat] 허용 patterns 추가 및 필터 추가
88dldl May 9, 2024
6742ca5
:recycle: [Refactor] 어노테이션 타입 확인 추가
88dldl May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/ssuPlector/controller/AuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ssuPlector.dto.response.AuthResponseDTO.TokenRefreshResponse;
import ssuPlector.global.response.ApiResponse;
import ssuPlector.security.handler.annotation.AuthUser;
import ssuPlector.security.handler.annotation.ExtractToken;
import ssuPlector.service.auth.AuthService;

@RestController
Expand All @@ -41,8 +42,7 @@ public ApiResponse<String> kakaoLogout(

@Operation(summary = "토큰 재발급", description = "토큰을 재발급 합니다._숙희")
@PostMapping("/kakao/refresh")
public ApiResponse<TokenRefreshResponse> refresh(
@RequestParam("refreshToken") String refreshToken) {
public ApiResponse<TokenRefreshResponse> refresh(@ExtractToken String refreshToken) {
Copy link
Member

@chanmin-00 chanmin-00 May 10, 2024

Choose a reason for hiding this comment

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

토큰 발급이랑 추출 방식의 차이가 잘 이해가 되지 않는데 어떤 이유로 바꾼 건가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

해당 어노테이션에서는 HTTP 요청 헤더에서 Authorization값을 추출해서 유효한지 체크하고 refreshToken으로 넘기는 과정으로 동작합니다! 그전에는 그냥 리프레시 토큰을 입력받는 형식으로 구성되어있는데, 그것보다 이후의 로직이 좀 더 나은거 같아 수정했습니다 !

return ApiResponse.onSuccess("토큰 재발급 완료", authService.refresh(refreshToken));
}
}