From 22d85a3dbdf118f6bb757cfa49451a893da2b787 Mon Sep 17 00:00:00 2001 From: Aleksander <170264518+t-aleksander@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:52:22 +0100 Subject: [PATCH] handle another callback url parsing error --- src/enterprise/handlers/openid_login.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/enterprise/handlers/openid_login.rs b/src/enterprise/handlers/openid_login.rs index 20786fec2..41cebd91d 100644 --- a/src/enterprise/handlers/openid_login.rs +++ b/src/enterprise/handlers/openid_login.rs @@ -37,7 +37,11 @@ use crate::{ }; async fn get_provider_metadata(url: &str) -> Result { - let issuer_url = IssuerUrl::new(url.to_string()).unwrap(); + let issuer_url = IssuerUrl::new(url.to_string()).map_err(|err| { + WebError::BadRequest(format!( + "Failed to create issuer URL from the provided URL: {url}. Error details: {err:?}", + )) + })?; // Discover the provider metadata based on a known base issuer URL // The url should be in the form of e.g. https://accounts.google.com // The url shouldn't contain a .well-known part, it will be added automatically