Skip to content

Commit

Permalink
callback api
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdjww committed Jul 4, 2024
1 parent 33765ee commit ebd3839
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/com/hackathon/TimeLapse/oauth/AuthController.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package com.hackathon.TimeLapse.oauth;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/auth")
public class AuthController {
private final OAuthLoginService oAuthLoginService;

@PostMapping("/kakao")
@PostMapping("/api/auth/kakao")
public ResponseEntity<AuthTokens> loginKakao(@RequestBody KakaoLoginParams params) {
return ResponseEntity.ok(oAuthLoginService.login(params));
}

@GetMapping("/login/oauth2/code/kakao")
public ResponseEntity<String> loginByKakao(@RequestParam final String code) {
return ResponseEntity.ok(code);
}
}

0 comments on commit ebd3839

Please sign in to comment.