Skip to content

Commit

Permalink
♻️ [Feat]: 카카오 로그인 컨트롤러 리펙토링
Browse files Browse the repository at this point in the history
- auth를 api/auth로 변경
  • Loading branch information
catturtle123 committed Jan 26, 2024
1 parent cbfeb1b commit aba7088
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/avab/avab/controller/AuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/auth")
public class AuthController {

private final AuthService authService;
Expand All @@ -25,7 +26,7 @@ public class AuthController {
@ApiResponses({
@ApiResponse(responseCode = "COMMON200", description = "OK, 성공"),
})
@GetMapping("/auth/login/kakao")
@GetMapping("/login/kakao")
public BaseResponse<OAuthResponse> kakaoLogin(@RequestParam("code") String code) {
return BaseResponse.onSuccess(authService.kakaoLogin(code));
}
Expand All @@ -36,7 +37,7 @@ public BaseResponse<OAuthResponse> kakaoLogin(@RequestParam("code") String code)
@ApiResponses({
@ApiResponse(responseCode = "COMMON200", description = "OK, 성공"),
})
@PostMapping("/auth/refresh")
@PostMapping("/refresh")
public BaseResponse<TokenRefreshResponse> refresh(@ExtractToken String refreshToken) {
return BaseResponse.onSuccess(authService.refresh(refreshToken));
}
Expand All @@ -45,7 +46,7 @@ public BaseResponse<TokenRefreshResponse> refresh(@ExtractToken String refreshTo
@ApiResponses({
@ApiResponse(responseCode = "COMMON200", description = "OK, 성공"),
})
@DeleteMapping("/auth/logout")
@DeleteMapping("/logout")
public BaseResponse<String> logout(@AuthUser User user) {
authService.logout(user.getId());
return BaseResponse.onSuccess("로그아웃에 성공하였습니다.");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/avab/avab/security/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class SecurityConfig {
"/api/recreations/search",
"/api/recreations/{recreationId}",
"/api/recreations/popular",
"/auth/login/kakao",
"/auth/refresh"
"/api/auth/login/kakao",
"/api/auth/refresh"
};

@Bean
Expand Down

0 comments on commit aba7088

Please sign in to comment.