Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #77 from FinFellows/feat/#76_editBookmark-api
Browse files Browse the repository at this point in the history
[REFACTOR]: 로그인 시 SecurityContextHolder에 인증정보 등록
  • Loading branch information
LEEJaeHyeok97 authored Jan 9, 2024
2 parents 6cf40e2 + e1394ce commit 71b3c8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.LinkedMultiValueMap;
Expand Down Expand Up @@ -194,7 +195,7 @@ public AuthRes kakaoLogin(KakaoProfile kakaoProfile) {
)
);


SecurityContextHolder.getContext().setAuthentication(authentication);

TokenMapping tokenMapping = customTokenProviderService.createToken(authentication);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import com.finfellows.domain.bookmark.application.FinancialProductBookmarkServiceImpl;
import com.finfellows.domain.bookmark.application.PolicyInfoBookmarkServiceImpl;
import com.finfellows.domain.bookmark.application.PostBookmarkServiceImpl;
import com.finfellows.domain.bookmark.dto.CmaFinancialProductBookmarkRes;
import com.finfellows.domain.bookmark.dto.PolicyInfoBookmarkRes;
import com.finfellows.domain.bookmark.dto.PostBookmarkRes;
import com.finfellows.global.config.security.token.CurrentUser;
import com.finfellows.global.config.security.token.UserPrincipal;
import com.finfellows.global.payload.ErrorResponse;
Expand Down Expand Up @@ -32,7 +35,7 @@ public class UserController {

@Operation(summary = "금융, 뭐하지 즐겨찾기 내역 조회", description = "금융, 뭐하지(금융 상품) 즐겨찾기 내역을 조회한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "금융, 뭐하지.(금융 상품) 즐겨찾기 조회 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = Message.class) ) } ),
@ApiResponse(responseCode = "200", description = "금융, 뭐하지.(금융 상품) 즐겨찾기 조회 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CmaFinancialProductBookmarkRes.class) ) } ),
@ApiResponse(responseCode = "400", description = "금융, 뭐하지.(금융 상품) 즐겨찾기 조회 실패", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class) ) } ),
})
@GetMapping("/financial-products")
Expand All @@ -44,7 +47,7 @@ public ResponseCustom<?> getBookmarkedFinancialProducts(

@Operation(summary = "금융, 배우자 즐겨찾기 내역 조회", description = "금융, 배우자(교육, 뉴스) 즐겨찾기 내역을 조회한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "금융, 배우자.(교육, 뉴스) 즐겨찾기 조회 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = Message.class) ) } ),
@ApiResponse(responseCode = "200", description = "금융, 배우자.(교육, 뉴스) 즐겨찾기 조회 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = PostBookmarkRes.class) ) } ),
@ApiResponse(responseCode = "400", description = "금융, 배우자.(교육, 뉴스) 즐겨찾기 조회 실패", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class) ) } ),
})
@GetMapping("/posts")
Expand All @@ -56,7 +59,7 @@ public ResponseCustom<?> getBookmarkPosts(

@Operation(summary = "금융, 고마워 즐겨찾기 내역 조회", description = "금융, 고마워(정책) 즐겨찾기 내역을 조회한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "금융, 고마워.(정책) 즐겨찾기 조회 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = Message.class) ) } ),
@ApiResponse(responseCode = "200", description = "금융, 고마워.(정책) 즐겨찾기 조회 성공", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = PolicyInfoBookmarkRes.class) ) } ),
@ApiResponse(responseCode = "400", description = "금융, 고마워.(정책) 즐겨찾기 조회 실패", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class) ) } ),
})
@GetMapping("/policy-infos")
Expand Down

0 comments on commit 71b3c8c

Please sign in to comment.