-
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.
- 기존의 RefreshToken, AccessToken 객체를 제거
- Loading branch information
Showing
6 changed files
with
50 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
package com.j9.bestmoments.domain; | ||
|
||
import lombok.Builder; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.annotation.Id; | ||
import java.util.UUID; | ||
import lombok.Getter; | ||
import org.springframework.data.redis.core.RedisHash; | ||
import org.springframework.data.redis.core.TimeToLive; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@RedisHash("Token") | ||
public class Token { | ||
@RedisHash(value = "Token") | ||
public | ||
class Token { | ||
|
||
@Id | ||
private String token; | ||
|
||
private TokenType tokenType; | ||
|
||
@TimeToLive | ||
private Long expiration; | ||
|
||
private UUID memberId; | ||
|
||
public Token(Member member, String token) { | ||
this.token = token; | ||
@Builder | ||
public Token(Member member, TokenType tokenType, String token) { | ||
this.memberId = member.getId(); | ||
this.token = token; | ||
this.tokenType = tokenType; | ||
this.expiration = tokenType.getExpiration(); | ||
} | ||
|
||
} |
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.j9.bestmoments.domain; | ||
|
||
import com.j9.bestmoments.constants.TokenExpiration; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum TokenType { | ||
|
||
ACCESS_TOKEN("accessToken", TokenExpiration.ACCESS_TOKEN), | ||
REFRESH_TOKEN("refreshToken", TokenExpiration.REFRESH_TOKEN), | ||
; | ||
|
||
private final String name; | ||
private final long expiration; | ||
|
||
} |
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