diff --git a/kodemy-api-gateway/src/main/java/pl/sknikod/kodemygateway/infrastructure/module/oauth2/OAuth2ReactiveAuthorizationManager.java b/kodemy-api-gateway/src/main/java/pl/sknikod/kodemygateway/infrastructure/module/oauth2/OAuth2ReactiveAuthorizationManager.java index 41c92648..11ace682 100644 --- a/kodemy-api-gateway/src/main/java/pl/sknikod/kodemygateway/infrastructure/module/oauth2/OAuth2ReactiveAuthorizationManager.java +++ b/kodemy-api-gateway/src/main/java/pl/sknikod/kodemygateway/infrastructure/module/oauth2/OAuth2ReactiveAuthorizationManager.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import reactor.core.publisher.Mono; +import java.time.Instant; import java.util.Map; @Component @@ -44,8 +45,7 @@ private Authentication toOAuth2LoginAuthenticationToken(OAuth2AuthorizationCodeA token.getAuthorizationExchange(), new DefaultOAuth2User(token.getAuthorities(), Map.of("name", token.getName()), "name"), token.getAuthorities(), - new OAuth2AccessToken(OAuth2AccessToken.TokenType.BEARER, token.getAccessToken().getTokenValue(), - token.getAccessToken().getIssuedAt(), token.getAccessToken().getExpiresAt()), + new OAuth2AccessToken(OAuth2AccessToken.TokenType.BEARER, "tokenValue", Instant.now(), Instant.now()), token.getRefreshToken() ); }