-
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.
- Loading branch information
Showing
5 changed files
with
44 additions
and
43 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...gFirstSeminar/src/main/java/org/sopt/springFirstSeminar/common/jwt/auth/RefreshToken.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,34 @@ | ||
package org.sopt.springFirstSeminar.common.jwt.auth; | ||
|
||
|
||
import jakarta.persistence.Id; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.data.redis.core.RedisHash; | ||
import org.springframework.data.redis.core.index.Indexed; | ||
|
||
@RedisHash(value = "", timeToLive = 60 * 60 * 24 * 1000L) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Getter | ||
@Builder(access = AccessLevel.PRIVATE) | ||
public class RefreshToken { | ||
|
||
@Id | ||
private Long id; | ||
|
||
@Indexed | ||
private String refreshToken; | ||
|
||
public static RefreshToken of(final Long userId, final String refreshToken) { | ||
return RefreshToken.builder() | ||
.id(userId) | ||
.refreshToken(refreshToken) | ||
.build(); | ||
} | ||
|
||
public void updateRefreshToken(final String refreshToken) { | ||
this.refreshToken = refreshToken; | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
...ngFirstSeminar/src/main/java/org/sopt/springFirstSeminar/common/jwt/auth/redis/Token.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
.../org/sopt/springFirstSeminar/common/jwt/auth/redis/repository/RefreshTokenRepository.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,9 @@ | ||
package org.sopt.springFirstSeminar.common.jwt.auth.redis.repository; | ||
|
||
import org.sopt.springFirstSeminar.common.jwt.auth.RefreshToken; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface RefreshTokenRepository extends CrudRepository<RefreshToken, Long> { | ||
} |
11 changes: 0 additions & 11 deletions
11
...in/java/org/sopt/springFirstSeminar/common/jwt/auth/redis/repository/TokenRepository.java
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