The discussion revolves around automatically generating a password for a user account created through the Discourse API. foloex suggests adding a feature to create a user without specifying a password, prompting the user to set a password during activation. However, vinothkannans recommends using the invitation feature instead, which allows users to accept the invitation and set their password.
foloex explores the invitation API but finds it poorly documented. vinothkannans suggests asking users for their password when registering through the contact form, but foloex prefers to have Discourse handle password creation due to security concerns.
vinothkannans offers to help foloex with the Invites API, providing a link to the official Ruby API client code. foloex successfully creates an invite using the POST /invites endpoint with an “email” field in the params and plans to test creating a user with a random password and triggering the password reset action.
So you are going to send email to activate the user? If yes then it’s better to send invites instead of creating accounts via API. Because invitations will activate the user instantly when they accept it and the password reset email will be sent.
The API about invitation is not well presented in the documentation… I guess I’ll have to read the code to find out how it works.
Is there a way to accept the invitation for the user and just send him the “reset password” mail ? The goal here is to easily add a willing user without asking him to set his password directly. In our case, we have a contact form on our website (with name, email and message) bearing a checkbox “register me on the forum”.
So I’d like the server handling the form to add the user to discourse though API.
We could do that, but the form handler isn’t yet behind a SSL layer so I’d rather have Discourse handling the password.
So I thought that if there was a way to do that more or less easily directly in Discourse it would be better. If not, I’ll fall back to your proposal