From 2629bcbe1380c894e3a7f52cafcac3988edb8fbb Mon Sep 17 00:00:00 2001 From: "Victor J. Fox" Date: Wed, 29 Jul 2026 16:13:44 +0300 Subject: [PATCH] Always send initOrganization and orgUserHasExistingUser in org invite URL (#7482) The bundled web vault (2026.6.4) requires seven query parameters in the accept-organization URL and rejects the invite client-side when any of them is null, showing only "Unable to accept invitation" without sending a request to the server. send_invite() never appended initOrganization, and appended orgUserHasExistingUser only for users who already had an account, so every organization invitation e-mail produced a link that could not be accepted. Web vault 2026.4.1 (shipped with 1.36.0) read these parameters null-safely, which is why this only appeared in 1.37.0. Fixes #7481 Co-authored-by: Claude Opus 5 --- src/mail.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mail.rs b/src/mail.rs index f31234d7..a7e5e5ae 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -307,9 +307,18 @@ pub async fn send_invite( if CONFIG.sso_enabled() && CONFIG.sso_only() { query_params.append_pair("orgSsoIdentifier", &org_id); } - if user.private_key.is_some() { - query_params.append_pair("orgUserHasExistingUser", "true"); - } + + // The web vault requires both of these parameters to be present. + // If either is missing it rejects the invite client-side, before any + // request reaches the server, showing only "Unable to accept invitation". + query_params.append_pair("initOrganization", "false"); + + let org_user_has_existing_user = if user.private_key.is_some() { + "true" + } else { + "false" + }; + query_params.append_pair("orgUserHasExistingUser", org_user_has_existing_user); } let Some(query_string) = query.query() else {