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

카카오/구글 소셜로그인, jwt, spring security 설정 #8

Merged
merged 13 commits into from
Feb 6, 2024

Conversation

strangehoon
Copy link
Member

@strangehoon strangehoon commented Feb 6, 2024

📕 연관 이슈 번호

#2

📙 작업 내용

구현 내용 및 작업 했던 내역

  • 카카오 소셜로그인
  • 구글 소셜로그인
  • 스프링 시큐리티

📗 논의 사항

PR을 볼 때 주의깊게 봐야하거나 말하고 싶은 점

  • 전부 정상적으로 잘 작동함
  • 추후 black list 도입할 예정

📘 체크리스트

  • 본인을 Assign해주시고, 본인을 제외한 백엔드 개발자를 Reviewer로 지정해주세요.
  • 라벨 체크해주세요.
  • .yml 파일 수정 내용이 있다면 공유해주세요.

@strangehoon strangehoon self-assigned this Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

Test Results

1 tests   0 ✅  0s ⏱️
1 suites  0 💤
1 files    1 ❌

For more details on these failures, see this check.

Results for commit 98bfc6a.

♻️ This comment has been updated with latest results.

@strangehoon strangehoon closed this Feb 6, 2024
@strangehoon strangehoon reopened this Feb 6, 2024
@strangehoon strangehoon added the ✨Feat 기능 추가 label Feb 6, 2024
Copy link
Member

@woo0doo woo0doo left a comment

Choose a reason for hiding this comment

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

고생 많이 하셨네요!! 수고하셨습니다 ㅎㅎ 👍

@Value("${oauth2.kakao.tokenUri}")
private String KAKAO_TOKEN_URI;

@Autowired
Copy link
Member

Choose a reason for hiding this comment

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

@Autowired 빼도 되지 않나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

뺐습니다!!

}

private String getAccessToken(String code) throws JsonProcessingException {
RestTemplate rt = new RestTemplate();
Copy link
Member

Choose a reason for hiding this comment

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

restTemplate을 webConfig 파일에 Bean 등록하는건 어때요??

Copy link
Member Author

Choose a reason for hiding this comment

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

좋습니다!!

return ApiResponse.success(null);
}

@GetMapping("/ex")
Copy link
Member

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.

까먹고 안지웠네요..ㅎㅎ 지우겠습니다!!

}

@Override
public int statusCode() {
Copy link
Member

Choose a reason for hiding this comment

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

헉 제가 인터페이스를 잘못만들었네요 getStatusCode랑 getMessage로 만들었어야했는데 제가 나중에 수정해서 올리겠습니다! 위에 @Getter만 하면 override할 필요 없어져서 깔끔해질 것 같아요!! 죄송합니당

Copy link
Member Author

Choose a reason for hiding this comment

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

괜찮습니다!!

import org.springframework.data.redis.serializer.StringRedisSerializer;

@Configuration
@RequiredArgsConstructor
Copy link
Member

Choose a reason for hiding this comment

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

@requiredargsconstructor는 빼도 될 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 알겠습니다!

import jakarta.validation.constraints.NotBlank;

public class AuthRequestDto{
public record RefreshTokenRequestDto(String refreshToken){}
Copy link
Member

Choose a reason for hiding this comment

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

저희 class안에 record 식 말고 record 하나씩 만들기로 했던 것 같아요!!

Copy link
Member Author

Choose a reason for hiding this comment

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

감사합니다!

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Where(clause = "isDeleted = false")
@SQLDelete(sql = "UPDATE Users SET isDeleted = true WHERE id = ?")
public class Users extends BaseEntity {
Copy link
Member

Choose a reason for hiding this comment

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

엇 ㅠㅠ 이거 @table(name = "users") 달고 User로 하기로 했었던 것 같아요!!

Copy link
Member Author

Choose a reason for hiding this comment

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

감사합니다!!


@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface UserId {
Copy link
Member

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.

넵 신기해요 ㅎㅎ!!

Copy link
Member

@woo0doo woo0doo left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!! 👍

@strangehoon strangehoon merged commit 1558998 into develop Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feat 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants