Skip to content

Commit

Permalink
[FEAT] 소셜 로그인 구현 동작확인하도록 ..merge해라
Browse files Browse the repository at this point in the history
  • Loading branch information
sung-silver committed Aug 30, 2023
1 parent 50c93d2 commit d99c2c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
29 changes: 0 additions & 29 deletions api/src/main/java/com/org/gunbbang/controller/OAuthController.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void checkAccessTokenAndAuthentication(HttpServletRequest request)

String accessToken = jwtService.extractAccessTokenAsString(request);
Long memberId = jwtService.extractMemberIdClaim(accessToken);
System.out.println("memberId = " + memberId);

memberRepository.findById(memberId).ifPresent(this::saveAuthentication);
}
Expand All @@ -158,7 +159,8 @@ public void saveAuthentication(Member myMember) {
new UsernamePasswordAuthenticationToken(
userDetailsUser, // principle
null, // credential (보통 비밀번호. 인증 시에는 null로 들어감)
authoritiesMapper.mapAuthorities(userDetailsUser.getAuthorities()));
authoritiesMapper.mapAuthorities(
userDetailsUser.getAuthorities())); // 여기서 반환되는 값이 달라져야할거같은디

// SecurityContext에 Authentication 객체 저장
SecurityContextHolder.getContext().setAuthentication(authentication);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public CustomUserDetails(
public Collection<? extends GrantedAuthority> getAuthorities() {
List<GrantedAuthority> auth = new ArrayList<>();
auth.add(new SimpleGrantedAuthority("USER"));
auth.add(new SimpleGrantedAuthority("Guest"));
return auth;
// return null;
}
Expand Down

0 comments on commit d99c2c7

Please sign in to comment.