-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from potenday-project/develop
카카오 로그인 방식 자동 로그인이 아닌 코드 반환 및 코드로 로그인하도록 변경
- Loading branch information
Showing
3 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package com.chwipoClova.user.controller; | ||
|
||
import com.chwipoClova.common.response.CommonResponse; | ||
import com.chwipoClova.common.response.MessageCode; | ||
import com.chwipoClova.user.request.UserLoginReq; | ||
import com.chwipoClova.user.response.UserInfoRes; | ||
import com.chwipoClova.user.response.UserLoginRes; | ||
import com.chwipoClova.user.response.UserSnsUrlRes; | ||
|
@@ -31,6 +29,18 @@ public class UserController { | |
|
||
private final UserService userService; | ||
|
||
@Operation(summary = "유저 정보 조회 (테스트용)", description = "유저 정보 조회 (테스트용)") | ||
@GetMapping("/getUserInfo") | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "OK") | ||
} | ||
) | ||
public UserInfoRes getUserInfo( | ||
@Schema(description = "이메일", example = "[email protected]", name = "email") @RequestParam(name = "email") String email | ||
) { | ||
return userService.selectUserInfo(email); | ||
} | ||
|
||
@Operation(summary = "카카오 로그인 URL", description = "카카오 로그인 URL") | ||
@GetMapping("/getKakaoUrl") | ||
@ApiResponses(value = { | ||
|
@@ -41,27 +51,25 @@ public UserSnsUrlRes getKakaoUrl() throws Exception { | |
return userService.getKakaoUrl(); | ||
} | ||
|
||
@Operation(summary = "카카오 로그인", description = "카카오 로그인") | ||
@GetMapping("/kakaoCallback") | ||
@Operation(summary = "카카오 로그인", description = "카카오 로그인 (카카오 로그인 URL 호출해서 로그인 성공하면 나오는 코드를 입력)") | ||
@GetMapping("/kakaoLogin") | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UserLoginRes.class))), | ||
@ApiResponse(responseCode = "700", description = "신규 가입되었습니다.", content = @Content(schema = @Schema(implementation = String.class))) | ||
} | ||
) | ||
public CommonResponse kakaoCallback(@Schema(description = "로그인코드", example = "1", name = "code") @RequestParam(name = "code") String code, HttpServletResponse response) throws Exception { | ||
public CommonResponse kakaoLogin(@Schema(description = "로그인코드", example = "1", name = "code") @RequestParam(name = "code") String code, HttpServletResponse response) throws Exception { | ||
return userService.kakaoLogin(code, response); | ||
} | ||
|
||
|
||
@Operation(summary = "유저 정보 조회 (테스트용)", description = "유저 정보 조회 (테스트용)") | ||
@GetMapping("/getUserInfo") | ||
@Hidden | ||
@Operation(summary = "카카오 로그인 콜백", description = "카카오 로그인 콜백") | ||
@GetMapping("/kakaoCallback") | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "OK") | ||
} | ||
) | ||
public UserInfoRes getUserInfo( | ||
@Schema(description = "이메일", example = "[email protected]", name = "email") @RequestParam(name = "email") String email | ||
) { | ||
return userService.selectUserInfo(email); | ||
public String kakaoCallback(@Schema(description = "로그인코드", example = "1", name = "code") @RequestParam(name = "code") String code, HttpServletResponse response) throws Exception { | ||
return code; | ||
} | ||
} |