Add conditional default for provider callback_url.

Co-authored-by: jeidnx <git@domainhier.de>
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-02-12 03:15:31 +00:00
parent 60d418118f
commit 2e19a30ff2

View File

@@ -212,6 +212,15 @@ async fn configure(&self, mut provider: Provider) -> Result<Provider> {
.map(|url| provider.token_url.replace(url));
}
if provider.callback_url.is_none()
&& let Some(server_url) = self.services.config.well_known.client.as_ref()
{
let callback_path =
format!("_matrix/client/unstable/login/sso/callback/{}", provider.client_id);
provider.callback_url = Some(server_url.join(&callback_path)?);
}
Ok(provider)
}