Skip to content

Commit

Permalink
Merge pull request #35 from Soongsil-CoffeeChat/fix/#33
Browse files Browse the repository at this point in the history
test commit
  • Loading branch information
KimKyoHwee authored Apr 13, 2024
2 parents b00a8ef + 25a5626 commit 4d99d8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,14 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse

//토큰에서 username과 role 획득
String username = jwtUtil.getUsername(accessToken);
System.out.println("username = " + username);
String role = jwtUtil.getRole(accessToken);
System.out.println("role = " + role);

//userDTO를 생성하여 값 set
UserDTO userDTO = new UserDTO();
userDTO.setUsername(username);
userDTO.setRole(role);

//UserDetails에 회원 정보 객체 담기
//UserDetails 혹은 OAuth2User에 회원 정보 객체 담기
CustomOAuth2User customOAuth2User = new CustomOAuth2User(userDTO);

//스프링 시큐리티 인증 토큰 생성
Expand All @@ -78,5 +76,6 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
SecurityContextHolder.getContext().setAuthentication(authToken);

filterChain.doFilter(request, response);
//
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.soongsil.CoffeeChat.dto.CreateMenteeRequest;
import com.soongsil.CoffeeChat.dto.CreateMentorRequest;
import com.soongsil.CoffeeChat.dto.CustomOAuth2User;
import com.soongsil.CoffeeChat.entity.Mentee;
import com.soongsil.CoffeeChat.entity.Mentor;
import com.soongsil.CoffeeChat.entity.User;
Expand Down

0 comments on commit 4d99d8c

Please sign in to comment.