[PR #2773] [MERGED] fix invitations of new users when mail is disabled #3144

Closed
opened 2026-03-03 09:26:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/2773
Author: @stefan0xC
Created: 9/27/2022
Status: Merged
Merged: 10/19/2022
Merged by: @dani-garcia

Base: mainHead: fix-invitation-of-new-users


📝 Commits (1)

  • 2215cfe fix invitations of new users when mail is disabled

📊 Changes

1 file changed (+5 additions, -6 deletions)

View changed files

📝 src/api/core/organizations.rs (+5 -6)

📄 Description

While testing locally (where I don't have mail enabled) I noticed that inviting a new user will save them as invited. Removing and inviting the same user again (or inviting them in a second organization) they will be listed as accepted instead. This should not happen, because until the user has actually created an account they cannot be confirmed yet (and without admin panel access you would not know when they have done so).

If you try to confirm an invitedaccepted but non-existing user you will be greeted with this error message:
client_error_1
(The error happens client side so there are no relevant server logs.)

Since registering an account automatically accepts the outstanding invitations for a user anyway, setting UserOrgStatus::Accepted can be limited to already registered users (when mail is disabled).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/2773 **Author:** [@stefan0xC](https://github.com/stefan0xC) **Created:** 9/27/2022 **Status:** ✅ Merged **Merged:** 10/19/2022 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `fix-invitation-of-new-users` --- ### 📝 Commits (1) - [`2215cfe`](https://github.com/dani-garcia/vaultwarden/commit/2215cfefb9d2affd55a5773bde49b37efeb11a32) fix invitations of new users when mail is disabled ### 📊 Changes **1 file changed** (+5 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/api/core/organizations.rs` (+5 -6) </details> ### 📄 Description While testing locally (where I don't have mail enabled) I noticed that inviting a new user will save them as [invited](https://github.com/dani-garcia/vaultwarden/blob/6fa6eb18e88f6d090eff5139d5a67bb56d25bf7f/src/api/core/organizations.rs#L625). Removing and inviting the same user again (or inviting them in a second organization) they will be listed as [accepted](https://github.com/dani-garcia/vaultwarden/blob/6fa6eb18e88f6d090eff5139d5a67bb56d25bf7f/src/api/core/organizations.rs#L606) instead. This should not happen, because until the user has actually created an account they cannot be confirmed yet (and without admin panel access you would not know when they have done so). If you try to confirm an <s>invited</s>accepted but non-existing user you will be greeted with this error message: ![client_error_1](https://user-images.githubusercontent.com/509385/192648379-4300e33b-04ba-48ec-a904-cb9e57efcc18.png) (The error happens client side so there are no relevant server logs.) Since registering an account [automatically accepts the outstanding invitations](https://github.com/dani-garcia/vaultwarden/blob/6fa6eb18e88f6d090eff5139d5a67bb56d25bf7f/src/api/core/accounts.rs#L119) for a user anyway, setting UserOrgStatus::Accepted can be limited to already registered users (when mail is disabled). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:26:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3144
No description provided.