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

[#68] 경로 부분 개방 #88

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ protected SecurityFilterChain securityFilterChain(
.authorizeHttpRequests(authHttp -> authHttp
.requestMatchers(
"/health",

"/oauth2/authorization/naver", // 로그인
"/getCarDuration", // 자가용 소요시간 api
"/login/oauth2/code/**", // code, state 반환
"/token/**", // 로컬에게 토큰 반환
"/oauth/**", // 프론트에게 토큰 반환

"/locations/regions/**", // 지역별 장소 리스트 조회
"/locations/**", // 장소 상세 조회
"/plans/search", // 여행계획 조회

"/users/**", // 로그아웃, 회원탈퇴
"/me/**" // 마이페이지
"/plans/search" // 여행계획 조회
)
.permitAll()
.anyRequest().permitAll()
//.anyRequest().authenticated()
//.anyRequest().permitAll()
.anyRequest().authenticated()

)
.oauth2Login(oauth2Login -> oauth2Login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void onAuthenticationSuccess(
String targetUrl = String.format(
"http://travel-compass.netlify.app/oauth/callback?access-token=%s&refresh-token=%s",
jwt.getAccessToken(), jwt.getRefreshToken()
// "http://localhost:8080/token?access-token=%s&refresh-token=%s", jwt.getAccessToken(), jwt.getRefreshToken()
// "http://localhost:8080/token/token?access-token=%s&refresh-token=%s", jwt.getAccessToken(), jwt.getRefreshToken()
);
// 실제 Redirect 응답 생성
getRedirectStrategy().sendRedirect(request, response, targetUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TokenController {
@ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON_200", description = "Success"),
})
@GetMapping("/token")
@GetMapping("/token/token")
public ResponseEntity<Map<String, String>> tokenPagge(
@RequestParam(name = "access-token") String accessToken,
@RequestParam(name = "refresh-token") String refreshToken
Expand Down