File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ JWKSType JWKSClient::getJWKS()
2626 auto now = std::chrono::high_resolution_clock::now ();
2727 auto diff = std::chrono::duration<double >(now - last_request_send).count ();
2828
29- if (diff < refresh_timeout)
29+ if (diff < refresh_timeout && cached_jwks. has_value () )
3030 {
3131 LOG_DEBUG (getLogger (" JWKSProvider" ), " Returning cached JWKS" );
32- return cached_jwks;
32+ return cached_jwks. value () ;
3333 }
3434
3535 Poco::Net::HTTPResponse response;
@@ -73,7 +73,7 @@ JWKSType JWKSClient::getJWKS()
7373 }
7474
7575 cached_jwks = std::move (parsed_jwks);
76- return cached_jwks;
76+ return cached_jwks. value () ;
7777}
7878
7979StaticJWKSParams::StaticJWKSParams (const std::string & static_jwks_, const std::string & static_jwks_file_)
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class JWKSClient : public IJWKSProvider
4343 Poco::URI jwks_uri;
4444
4545 std::shared_mutex mutex;
46- JWKSType cached_jwks;
46+ std::optional< JWKSType> cached_jwks;
4747 std::chrono::time_point<std::chrono::high_resolution_clock> last_request_send;
4848};
4949
You can’t perform that action at this time.
0 commit comments