Skip to content

Commit

Permalink
Merge pull request #104 from EWHA-LUX/feature/#40
Browse files Browse the repository at this point in the history
[Fix] redis host λ³€κ²½, Redis CLI μ‹€ν–‰
  • Loading branch information
julia-heo authored May 28, 2024
2 parents 588422e + 3707f56 commit 4dbc681
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ jobs:
sudo docker rm -f $(docker ps -qa)
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}
sudo docker-compose up -d
sudo docker image prune -f
sudo docker image prune -f
sudo docker exec -i -t redis redis-cli
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public void postLogout(HttpServletRequest request, Users nowuser) throws CustomE
redisService.setAccessBlackValueWithTTL(accessToken,"logout",expiration, TimeUnit.MILLISECONDS);
// λ¦¬ν”„λ ˆμ‹œ 토큰 μ‚­μ œ
redisService.deleteValue(REFRESH_TOKEN_PREFIX+nowuser.getId().toString());
System.out.println("μ™•μ™•μ™•μ™•μ™•");
}

public void deleteUsers(Users nowUser) throws CustomException {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ewha/lux/once/global/security/JwtProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public Users extractUsersFromToken(String token) {
// accessToken 만료 μ‹œκ°„ λ°˜ν™˜
public Long getExpiration(String token) {
Claims claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token).getBody();
return claims.getExpiration().getTime();
long expirationTime = claims.getExpiration().getTime(); // 만료 μ‹œκ°„
long currentTime = System.currentTimeMillis(); // ν˜„μž¬ μ‹œκ°„
return expirationTime - currentTime; // 남은 μ‹œκ°„
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
data:
redis:
host: redis
host: ${EC2_IPV4}
port: 6379
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
Expand Down

0 comments on commit 4dbc681

Please sign in to comment.