Skip to content

Commit

Permalink
Fix Duo Redirect not using path
Browse files Browse the repository at this point in the history
The URL crate treats `https://domain.tld/path` differently then
`https://domain.tld/path/` the latter will make sure a `.join()` will
append the given path instead of using the base as a relative path.

Fixes dani-garcia#4858
  • Loading branch information
BlackDex authored and dfunkt committed Aug 15, 2024
1 parent 6a57c8a commit bc5d260
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/core/two_factor/duo_oidc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub async fn purge_duo_contexts(pool: DbPool) {
// Construct the url that Duo should redirect users to.
fn make_callback_url(client_name: &str) -> Result<String, Error> {
// Get the location of this application as defined in the config.
let base = match Url::parse(CONFIG.domain().as_str()) {
let base = match Url::parse(&format!("{}/", CONFIG.domain())) {
Ok(url) => url,
Err(e) => err!(format!("Error parsing configured domain URL (check your domain configuration): {e:?}")),
};
Expand Down

0 comments on commit bc5d260

Please sign in to comment.