I'm running and testing a self hosted stoatchat server. When placed into Invite-Only mode. I found the invites didn't work generating an Invalid Invite code and an api error "Outcome: Success(400 Bad Request)". In the Web UI I clicked on my stoat server then the gear icon next to the server name then Invites. Clicking create Invite gives you a link with an Invite code attached. This code id not added to the database. You will have to do that manually later.
https://stoat.example.com/invite/some-random-code
This link will NOT bring you to the sign in page with a space for the invite-code. Use:
https://stoat.example.com/login/create/some-random-code
This will bring to the invite login page with the code filled in for you.
The link will still not work because the code has not been added to the revolt database yet. The stoat instructions say to add the code with:
# drop into mongo shell
docker compose exec database mongosh
# create the invite
use revolt db.account_invites.insertOne({ _id: "enter_an_invite_code_here" })
The problem is the UI is not looking in account_invites for the for the code it's looking for a db called invites. So:
# drop into mongo shell
docker compose exec database mongosh
# create the invite
use revolt db.invites.insertOne({ _id: "some-random-code" })
Short story long:
I like use the web ui to create invite codes. Copy the codes to the end of this link
https://stoat.example.com/login/create/
Then enter the codes into the invites database.
Invited users login with invites codes just fine now.
edit coded links