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

feat : kakaoLogin #67

Merged
merged 1 commit into from
Jan 22, 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
14 changes: 7 additions & 7 deletions src/main/java/mvc/promiseme/users/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mvc.promiseme.common.exception.ErrorResponse;
import mvc.promiseme.kakao.KakaoApi;
import mvc.promiseme.project.dto.ProjectResponseDTO;
import mvc.promiseme.users.dto.KakaoResponseDTO;
import mvc.promiseme.users.dto.LoginRequestDTO;
import mvc.promiseme.users.dto.LoginResponseDTO;
import mvc.promiseme.users.dto.UserDTO;
Expand Down Expand Up @@ -63,14 +64,13 @@ public class UserController {

@Operation(summary = "카카오로그인", description = "카카오 로그인 창으로 이동 ")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = Map.class))),
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = Map.class)))
})
@GetMapping("user/loginKakao")
public ResponseEntity<Map<String,String>> kakaoLogin(){
Map<String,String> map = new HashMap<>();
map.put("kakaoApiKey", kakaoApi.getKakaoApiKey());
map.put("redirectUri", kakaoApi.getKakaoRedirectUri());
return ResponseEntity.ok(map);
@PostMapping("user/loginKakao")
public ResponseEntity<KakaoResponseDTO> kakaoLogin(){
KakaoResponseDTO kakaoResponseDTO = new KakaoResponseDTO(kakaoApi.getKakaoApiKey(),kakaoApi.getKakaoRedirectUri());

return ResponseEntity.ok(kakaoResponseDTO);
}

@GetMapping("/login/oauth/kakao")
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/mvc/promiseme/users/dto/KakaoResponseDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package mvc.promiseme.users.dto;

import lombok.*;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Builder
public class KakaoResponseDTO {
private String kakaoApiKey;
private String redirectUri;
// private String token;
}