diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/controller/OauthController.java b/backend/baton/src/main/java/touch/baton/domain/oauth/controller/OauthController.java index 29bcf7b29..82211532d 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/controller/OauthController.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/controller/OauthController.java @@ -5,7 +5,6 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -18,7 +17,7 @@ import static org.springframework.http.HttpStatus.FOUND; @RequiredArgsConstructor -@RequestMapping("/oauth") +@RequestMapping("/api/v1/oauth") @RestController public class OauthController { @@ -34,7 +33,7 @@ public ResponseEntity redirectAuthCode(@PathVariable("oauthType") final Oa return ResponseEntity.status(FOUND).build(); } - @PostMapping("/login/{oauthType}") + @GetMapping("/login/{oauthType}") public ResponseEntity login(@PathVariable final OauthType oauthType, @RequestParam final String code ) { diff --git a/backend/baton/src/test/java/touch/baton/document/oauth/github/GithubOauthApiTest.java b/backend/baton/src/test/java/touch/baton/document/oauth/github/GithubOauthApiTest.java index 3fc2dd30c..dd0e3c89c 100644 --- a/backend/baton/src/test/java/touch/baton/document/oauth/github/GithubOauthApiTest.java +++ b/backend/baton/src/test/java/touch/baton/document/oauth/github/GithubOauthApiTest.java @@ -18,7 +18,6 @@ import static org.springframework.restdocs.headers.HeaderDocumentation.headerWithName; import static org.springframework.restdocs.headers.HeaderDocumentation.responseHeaders; import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get; -import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post; import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; import static org.springframework.restdocs.request.RequestDocumentation.pathParameters; import static org.springframework.restdocs.request.RequestDocumentation.queryParameters; @@ -46,7 +45,7 @@ void github_redirect_auth_code() throws Exception { .thenReturn(githubOauthConfig.redirectUri()); // then - mockMvc.perform(get("/oauth/{oauthType}", "github")) + mockMvc.perform(get("/api/v1/oauth/{oauthType}", "github")) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl(githubOauthConfig.redirectUri())) .andDo(restDocs.document( @@ -65,7 +64,7 @@ void github_login() throws Exception { .thenReturn("Bearer Jwt"); // then - mockMvc.perform(post("/oauth/login/{oauthType}", "github") + mockMvc.perform(get("/api/v1/oauth/login/{oauthType}", "github") .queryParam("code", "authcode") .contentType(APPLICATION_JSON) .characterEncoding(UTF_8)