User Registration in the API
User Registration in the API
The POST /user/register endpoint has been a stub for some time now, but as of the next version of PieFed, that endpoint has been implemented (relevant PR). I wanted to walk through some of the specifics as a couple other endpoints were touched on to make this happen.
Updates to GET /site
There are a couple fields I added to GET /site to help aid registration:
• captcha_enabled - Lets you know if registration requires a captcha as well.
• application_question - If the registration mode is RequireApplication, this field lets you know what the registration question is.
• require_email_verification - Lets you know if the site requires email addresses to be verified before the application is reviewed or the user can be active.
Updates to GET /user/get_captcha
Pretty simple change on this endpoint. Basically, I updated this endpoint so that it no longer includes extraneous newline characters in the base64 encoded data.
———
The actual POST /user/register endpoint itself is fairly straightforward. I tried to include lots descriptive error messages if there are issues with the registration. Another note is that the endpoint has a rate limit of just 15/hour. Instance admins can add IP addresses to an allowlist to bypass this limit using the SKIP_RATE_LIMIT_IPS environment variable.
This endpoint is now live on crust. Let me know if you run into issues or have questions.
Comments