mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
feat: Add user registration via Web UI
This commit is contained in:
parent
1c295b4d8d
commit
d79e718e15
12 changed files with 215 additions and 11 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue