fix: better jwks refresh errors

reporting error response status (ref #59, #55)
This commit is contained in:
cduvray 2024-09-03 08:27:35 +02:00
parent 29ec07bd87
commit 10a926c25b

View file

@ -161,6 +161,11 @@ impl KeyStore {
self.fail_time = Some(Instant::now());
AuthError::JwksRefreshError(e.to_string())
})?
.error_for_status()
.map_err(|e| {
self.fail_time = Some(Instant::now());
AuthError::JwksRefreshError(e.to_string())
})?
.json::<JwkSet>()
.await
.map(|jwks| {