Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] redis host 변경, Redis CLI 실행 #104

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading