-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] 토큰 재발급 로직 변경
- Loading branch information
Showing
3 changed files
with
10 additions
and
11 deletions.
There are no files selected for viewing
11 changes: 4 additions & 7 deletions
11
src/main/java/com/sanbosillok/sanbosillokserver/api/auth/controller/TokenController.java
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,23 +1,20 @@ | ||
package com.sanbosillok.sanbosillokserver.api.auth.controller; | ||
|
||
import com.sanbosillok.sanbosillokserver.api.auth.dto.AccessTokenResponse; | ||
import com.sanbosillok.sanbosillokserver.api.auth.dto.RefreshTokenRequest; | ||
import com.sanbosillok.sanbosillokserver.api.auth.dto.ReissueTokenResponse; | ||
import com.sanbosillok.sanbosillokserver.api.auth.service.TokenService; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/token") | ||
public class TokenController { | ||
private final TokenService tokenService; | ||
|
||
@GetMapping("/refresh") | ||
public AccessTokenResponse getNewToken(@RequestBody @Valid RefreshTokenRequest refreshTokenRequest) { | ||
@PostMapping("/refresh") | ||
public ReissueTokenResponse getNewToken(@RequestBody @Valid RefreshTokenRequest refreshTokenRequest) { | ||
return tokenService.reIssueAccessToken(refreshTokenRequest.getRefreshToken()); | ||
} | ||
} |
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