From f3ecc8c7bdb0e0e6d1adcce968524a8840630a2d Mon Sep 17 00:00:00 2001 From: Jalen Francis Date: Tue, 31 Mar 2026 21:02:41 -0400 Subject: [PATCH] Add authType field to Send API responses Fixes #6976 - Sends were incorrectly showing as password protected in the web UI even when no password was set. The web-vault recently changed to use the authType field to determine protection status instead of just checking for the presence of the password field. This change adds the authType field to Send API responses: - authType: 0 = no authentication required - authType: 1 = password protected This aligns Vaultwarden's API with the updated web-vault expectations. --- src/db/models/send.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/db/models/send.rs b/src/db/models/send.rs index 8180f843..894743ac 100644 --- a/src/db/models/send.rs +++ b/src/db/models/send.rs @@ -131,6 +131,9 @@ impl Send { data["size"] = Value::String(size.to_string()); } + // Determine authType based on Bitwarden's AuthType enum: Email=0, Password=1, None=2 + let auth_type = if self.password_hash.is_some() { 1 } else { 2 }; + json!({ "id": self.uuid, "accessId": BASE64URL_NOPAD.encode(Uuid::parse_str(&self.uuid).unwrap_or_default().as_bytes()), @@ -145,6 +148,7 @@ impl Send { "maxAccessCount": self.max_access_count, "accessCount": self.access_count, "password": self.password_hash.as_deref().map(|h| BASE64URL_NOPAD.encode(h)), + "authType": auth_type, "disabled": self.disabled, "hideEmail": self.hide_email,