Skip to content

Commit

Permalink
feat : 토큰 재발급 swagger 추가 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjKim1229 committed May 27, 2024
1 parent 6c4f7c3 commit dea8b63
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import com.clubber.ClubberServer.global.infrastructure.outer.api.oauth.dto.KakaoTokenResponse;
import com.clubber.ClubberServer.global.infrastructure.outer.api.oauth.dto.KakaoUserInfoResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.headers.Header;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -44,12 +47,16 @@ public ResponseEntity getCredentialFromKakao(@RequestParam String code){
.body(kakaoOauthResponse);
}

@Operation(summary = "토큰 재발급", description = "토큰 만료시 호출 API")
@Operation(summary = "토큰 재발급", description = "토큰 만료시 호출 API",
parameters = {
@Parameter(name = "refreshToken", description = "헤더에 리프레시 토큰 전달", in = ParameterIn.HEADER),
@Parameter(name = "refreshToken", description = "쿠키에 리프레시 토큰 전달 (추후에 적용)", in = ParameterIn.COOKIE)
})
@PostMapping("/refresh")
@DisableSwaggerSecurity
public ResponseEntity<KakaoOauthResponse> tokenRefresh(
@CookieValue(value = "refreshToken", required = false) String refreshTokenCookie,
@RequestHeader(value = "token", required = false, defaultValue = "") String refreshToken){
@RequestHeader(value = "refreshToken", required = false, defaultValue = "") String refreshToken){

KakaoOauthResponse kakaoOauthResponse = authService.tokenRefresh(
refreshTokenCookie != null ? refreshTokenCookie : refreshToken);
Expand Down

0 comments on commit dea8b63

Please sign in to comment.