From bf41effadc32a6e3f7c14c599100db78aa9da729 Mon Sep 17 00:00:00 2001 From: Simon Bihel Date: Thu, 1 Sep 2022 15:14:21 +0100 Subject: [PATCH] Fix URL comparison by not using strings Close #36 --- src/oidc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oidc.rs b/src/oidc.rs index 3a6ee15..05c623b 100644 --- a/src/oidc.rs +++ b/src/oidc.rs @@ -577,7 +577,7 @@ pub async fn sign_in( .map_err(|e| anyhow!("Failed signature validation: {}", e))?; let domain = params.redirect_uri.url(); - if domain.to_string() != *siwe_cookie.message.resources.get(0).unwrap().to_string() { + if *domain != Url::from_str(siwe_cookie.message.resources.get(0).unwrap().as_ref()).unwrap() { return Err(anyhow!("Conflicting domains in message and redirect").into()); } if session_entry.siwe_nonce != siwe_cookie.message.nonce {