aboutsummaryrefslogtreecommitdiff
path: root/src/dav
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-02-27 18:33:49 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-02-27 18:33:49 +0100
commit7f35e68bfe21c61f4da9e37f127dd7abb73291fa (patch)
tree2889fc4ee0ef7451b22b0c34826e9d0187e8e49f /src/dav
parent9a58a4e932156e0207380bb3b0a93a59864b0e1c (diff)
downloadaerogramme-7f35e68bfe21c61f4da9e37f127dd7abb73291fa.tar.gz
aerogramme-7f35e68bfe21c61f4da9e37f127dd7abb73291fa.zip
Refactor
Diffstat (limited to 'src/dav')
-rw-r--r--src/dav/mod.rs7
1 files changed, 7 insertions, 0 deletions
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