Skip to content

Commit 21d13f9

Browse files
committed
Simplify OIDC middleware request handling for unprotected paths
1 parent 9aead0f commit 21d13f9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/webserver/oidc.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,15 @@ where
246246
log::trace!("Started OIDC middleware request handling");
247247

248248
let protected_paths = &self.oidc_state.config.protected_paths;
249-
if !protected_paths.iter().any(|path| request.path().starts_with(path)) {
249+
if !protected_paths
250+
.iter()
251+
.any(|path| request.path().starts_with(path))
252+
{
250253
log::debug!(
251254
"The request path {} is not in a protected path, skipping OIDC authentication",
252255
request.path()
253256
);
254-
let future = self.service.call(request);
255-
return Box::pin(async move {
256-
let response = future.await?;
257-
Ok(response)
258-
});
257+
return Box::pin(self.service.call(request));
259258
}
260259

261260
let oidc_client = Arc::clone(&self.oidc_state.client);

0 commit comments

Comments
 (0)