[GH-ISSUE #1385] setting up invitation #935

Closed
opened 2026-03-03 02:04:48 +03:00 by kerem · 5 comments
Owner

Originally created by @DuredhelFinceleb on GitHub (Feb 12, 2021).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1385

Hi !

not sure if it's a bug or me doing something wrong

I'm using the docker image with -e flags (so no config via admin)
regarding inivitations, I've used INVITATIONS_ALLOWED=false
I've also disallowed creation of new users
My goal: I want people to come in on invitation only and I want the admin to be the only one able to send invitations

My problem is that even with INVITATIONS_ALLOWED=false, users can create org and from the the org management screen they can invite whoever they want

here's my config
-v /bw-data/:/data/
-p 3080:3080
-p 3012:3012
-u 1004:1005
-e ROCKET_PORT=3080
-e DOMAIN=https://example.com/vault/
-e IP_HEADER=X-Forwarded-For
-e WEBSOCKET_ENABLED=true
-e SIGNUPS_ALLOWED=false
-e INVITATIONS_ALLOWED=false
-e ADMIN_TOKEN=xxx
-e INVITATION_ORG_NAME=xxx
-e SMTP_HOST=example.com
-e SMTP_FROM=xxx@example.com
-e SMTP_PORT=587
-e SMTP_SSL=true
-e SMTP_USERNAME=xxx@example.com
-e SMTP_PASSWORD=xxx
-e SHOW_PASSWORD_HINT=false
-e LOG_FILE=/data/bitwarden.log \

In the admin I can see that my flags are respected
image

For the admin I can still see and make work the invitation system, but that does not bother me, I want that.

In the user's vault, in the Organization management I can still see the Invitation button.
image

If I click it the dialog appears and everything works: mail is sent, user can come in & create an account
image

Ideally I would like the button to just no be there.
If it has to stay there, then I'd like to get an error message when clicking on it or when clicking on Save in the dialog.

Could not find anything about this in the wiki nor in the issues.
Am I missing something?

Best regards

Originally created by @DuredhelFinceleb on GitHub (Feb 12, 2021). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1385 Hi ! not sure if it's a bug or me doing something wrong I'm using the docker image with -e flags (so no config via admin) regarding inivitations, I've used INVITATIONS_ALLOWED=false I've also disallowed creation of new users My goal: I want people to come in on invitation only and I want the admin to be the only one able to send invitations My problem is that even with INVITATIONS_ALLOWED=false, users can create org and from the the org management screen they can invite whoever they want here's my config -v /bw-data/:/data/ \ -p 3080:3080 \ -p 3012:3012 \ -u 1004:1005 \ -e ROCKET_PORT=3080 \ -e DOMAIN=https://example.com/vault/ \ -e IP_HEADER=X-Forwarded-For \ -e WEBSOCKET_ENABLED=true \ -e SIGNUPS_ALLOWED=false \ -e INVITATIONS_ALLOWED=false \ -e ADMIN_TOKEN=xxx \ -e INVITATION_ORG_NAME=xxx \ -e SMTP_HOST=example.com \ -e SMTP_FROM=xxx@example.com \ -e SMTP_PORT=587 \ -e SMTP_SSL=true \ -e SMTP_USERNAME=xxx@example.com \ -e SMTP_PASSWORD=xxx \ -e SHOW_PASSWORD_HINT=false \ -e LOG_FILE=/data/bitwarden.log \ In the admin I can see that my flags are respected ![image](https://user-images.githubusercontent.com/9292585/107805819-32204700-6d66-11eb-876e-d0f2e2f0ed33.png) For the admin I can still see and make work the invitation system, but that does not bother me, I want that. In the user's vault, in the Organization management I can still see the Invitation button. ![image](https://user-images.githubusercontent.com/9292585/107806009-7ad80000-6d66-11eb-91f4-23c19d4cfcbc.png) If I click it the dialog appears and everything works: mail is sent, user can come in & create an account ![image](https://user-images.githubusercontent.com/9292585/107806129-b07ce900-6d66-11eb-81fb-e619df08dceb.png) Ideally I would like the button to just no be there. If it has to stay there, then I'd like to get an error message when clicking on it or when clicking on Save in the dialog. Could not find anything about this in the wiki nor in the issues. Am I missing something? Best regards
kerem 2026-03-03 02:04:48 +03:00
Author
Owner

@thelittlefireman commented on GitHub (Feb 12, 2021):

hi,
It seems to have an error on organization/invite github.com/dani-garcia/bitwarden_rs@c836f88ff2/src/api/core/organizations.rs (L508-L524)

!CONFIG.invitations_allowed and !CONFIG.is_email_domain_allowed(&email) seems to not be on the right place None => they should be in Some too.

I will try to reproduce and make a PR to fix this.
Reminder : Test with admin too

<!-- gh-comment-id:778401509 --> @thelittlefireman commented on GitHub (Feb 12, 2021): hi, It seems to have an error on organization/invite https://github.com/dani-garcia/bitwarden_rs/blob/c836f88ff2a7f94ee7427ae04b91e702a31ab52a/src/api/core/organizations.rs#L508-L524 `!CONFIG.invitations_allowed` and `!CONFIG.is_email_domain_allowed(&email)` seems to not be on the right place `None =>` they should be in `Some` too. I will try to reproduce and make a PR to fix this. Reminder : Test with admin too
Author
Owner

@BlackDex commented on GitHub (Feb 12, 2021):

No, it's at the right place.
It checks if the user is already in the system, if not (none) it will do these checks. Else, the user is already invited before or via the admin interface and maybe be added.

<!-- gh-comment-id:778406801 --> @BlackDex commented on GitHub (Feb 12, 2021): No, it's at the right place. It checks if the user is already in the system, if not (`none`) it will do these checks. Else, the user is already invited before or via the admin interface and maybe be added.
Author
Owner

@thelittlefireman commented on GitHub (Feb 12, 2021):

No, it's at the right place.
It checks if the user is already in the system, if not none it will do these checks. Else, the user is already invited before and maybe be add.

you're right my bad.

@DuredhelFinceleb I cannot reproduce. As a user, I don't get any "invite a user" button. Do you use the latest version of web and server ?

<!-- gh-comment-id:778412880 --> @thelittlefireman commented on GitHub (Feb 12, 2021): > No, it's at the right place. > It checks if the user is already in the system, if not `none` it will do these checks. Else, the user is already invited before and maybe be add. you're right my bad. @DuredhelFinceleb I cannot reproduce. As a user, I don't get any "invite a user" button. Do you use the latest version of web and server ?
Author
Owner

@DuredhelFinceleb commented on GitHub (Feb 12, 2021):

AFAIK, I've got the latest version

image

<!-- gh-comment-id:778493118 --> @DuredhelFinceleb commented on GitHub (Feb 12, 2021): AFAIK, I've got the latest version ![image](https://user-images.githubusercontent.com/9292585/107829889-efbd3100-6d8a-11eb-84e3-8cb23f61934a.png)
Author
Owner

@DuredhelFinceleb commented on GitHub (Feb 12, 2021):

OK guys I've got it
I must've forget to restart the container after changing my config (it's getting late...)
well I restarted the server to be sure and now when I click on save, I get a error 'user does not exist'
so users can still have organization but they can only invite people who already have an account => perfect!
thanks for the help and for pointing to the piece of code, it helped me a lot understanding what was the expected behaviour & how to test it

<!-- gh-comment-id:778498760 --> @DuredhelFinceleb commented on GitHub (Feb 12, 2021): OK guys I've got it I must've forget to restart the container after changing my config (it's getting late...) well I restarted the server to be sure and now when I click on save, I get a error 'user does not exist' so users can still have organization but they can only invite people who already have an account => perfect! thanks for the help and for pointing to the piece of code, it helped me a lot understanding what was the expected behaviour & how to test it
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#935
No description provided.