Update config.rs

This commit is contained in:
Eugene 2024-10-23 09:32:04 +02:00
parent 3e12cdb84a
commit b51b02db3b
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4

View file

@ -155,14 +155,13 @@ impl SsoInternalProviderConfig {
}
SsoInternalProviderConfig::Custom { issuer_url, .. } => {
let mut url = issuer_url.url().clone();
let path = url.path().to_owned();
if let Some(path) = path.strip_suffix("/.well-known/openid-configuration") {
url.set_path(path);
let url_string = url.to_string();
IssuerUrl::new(url_string.trim_end_matches('/').into())?
} else {
issuer_url.clone()
}
let path = url.path();
let path = path
.strip_suffix(".well-known/openid-configuration")
.unwrap_or(path)
.to_owned();
url.set_path(&path);
IssuerUrl::from_url(url)
}
})
}