From b6fc4a6bde45a98e453d343344111215e53e47a9 Mon Sep 17 00:00:00 2001 From: tom27052006 <83423411+tom27052006@users.noreply.github.com> Date: Fri, 13 Nov 2026 17:14:56 +0100 Subject: [PATCH] Return NotFound for denied collection access --- src/auth.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auth.rs b/src/auth.rs index 68309f88..d6f526c2 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -961,7 +961,9 @@ async fn collection_headers(request: &Request<'_>, action: CollectionAction) -> Collection::is_coll_manageable_by_user(&col_id, &headers.membership.user_uuid, &conn).await }; if !allowed { - err_handler!("The current user isn't a manager for this collection") + // NotFound as in Bitwarden, the web vault logs the user out on a 401 + error!(target: "auth", "Collection not found. The current user isn't a manager for this collection"); + return Outcome::Error((rocket::http::Status::NotFound, "Collection not found")); } Outcome::Success(headers) }