feat: Add user registration via Web UI

This commit is contained in:
Jesse Wierzbinski 2023-12-08 18:45:36 -10:00
parent 1c295b4d8d
commit d79e718e15
No known key found for this signature in database
12 changed files with 215 additions and 11 deletions

View file

@ -15,7 +15,7 @@ export const meta = applyConfig({
duration: 60,
},
auth: {
required: true,
required: false,
},
});
@ -176,10 +176,13 @@ export default async (req: Request): Promise<Response> => {
.join(", ")}`
)
.join(", ");
return jsonResponse({
error: `Validation failed: ${errorsText}`,
details: errors.details,
});
return jsonResponse(
{
error: `Validation failed: ${errorsText}`,
details: errors.details,
},
422
);
}
await createNewLocalUser({

View file

@ -101,15 +101,19 @@ export default async (): Promise<Response> => {
description: "A test instance",
email: "",
invites_enabled: false,
registrations: true,
registrations: config.signups.registration,
languages: ["en"],
rules: [],
rules: config.signups.rules.map((r, index) => ({
id: String(index),
text: r,
})),
stats: {
domain_count: knownDomainsCount,
status_count: statusCount,
user_count: userCount,
},
thumbnail: "",
tos_url: config.signups.tos_url,
title: "Test Instance",
uri: new URL(config.http.base_url).hostname,
urls: {