From 339612c917ce6e47ac79359c711e42ee18833123 Mon Sep 17 00:00:00 2001 From: Mathijs van Veluw Date: Thu, 15 Aug 2024 12:29:51 +0200 Subject: [PATCH] Fix Duo Redirect not using path (#4862) 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 #4858 --- src/api/core/two_factor/duo_oidc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/core/two_factor/duo_oidc.rs b/src/api/core/two_factor/duo_oidc.rs index 9b7e7f12..d252df91 100644 --- a/src/api/core/two_factor/duo_oidc.rs +++ b/src/api/core/two_factor/duo_oidc.rs @@ -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 { // 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:?}")), };