-
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.
Merge pull request #46 from Tico-Corp/feature-be/TICO-224-reissue-token
[FEAT] 토큰 재발급 기능 구현 (TICO-224)
- Loading branch information
Showing
16 changed files
with
447 additions
and
52 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
18 changes: 18 additions & 0 deletions
18
backend/pomoro-do/src/main/java/com/tico/pomoro_do/domain/user/dto/response/TokenDTO.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.tico.pomoro_do.domain.user.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Schema(description = "JWT Response") | ||
public class TokenDTO { | ||
|
||
@Schema(description = "Access Token", nullable = false) | ||
private String accessToken; | ||
|
||
@Builder | ||
public TokenDTO(String accessToken){ | ||
this.accessToken = accessToken; | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
.../pomoro-do/src/main/java/com/tico/pomoro_do/domain/user/repository/RefreshRepository.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.tico.pomoro_do.domain.user.repository; | ||
|
||
import com.tico.pomoro_do.domain.user.entity.Refresh; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
public interface RefreshRepository extends JpaRepository<Refresh, Long> { | ||
|
||
// 해당 리프레쉬 토큰의 존재 여부를 판단하는 메소드 | ||
Boolean existsByRefreshToken(String refreshToken); | ||
|
||
// 해당 리프레쉬 토큰을 삭제하는 메소드 | ||
@Transactional | ||
void deleteByRefreshToken(String refreshToken); | ||
|
||
// 사용자 이름을 기준으로 모든 리프레쉬 토큰을 삭제하는 메소드 | ||
@Transactional | ||
void deleteByUsername(String username); | ||
} |
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
Oops, something went wrong.