From 7f35e68bfe21c61f4da9e37f127dd7abb73291fa Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 27 Feb 2024 18:33:49 +0100 Subject: Refactor --- src/dav/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dav') diff --git a/src/dav/mod.rs b/src/dav/mod.rs index 709abd5..ac25f2d 100644 --- a/src/dav/mod.rs +++ b/src/dav/mod.rs @@ -106,6 +106,13 @@ async fn auth( .ok_or(anyhow!("Missing colon in Authorization, can't split decoded value into a username/password pair"))?; // Call login provider + let creds = match login.login(username, password).await { + Ok(c) => c, + Err(e) => return Ok(Response::builder() + .status(401) + .body(Full::new(Bytes::from("Wrong credentials")))?), + }; + // Call router with user -- cgit v1.2.3