mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-08 16:14:22 +01:00
Remove DITTO_ENV config, make registrations always open
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { NostrFilter } from '@soapbox/nspec';
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { insertUser } from '@/db/users.ts';
|
||||
import { nip19, z } from '@/deps.ts';
|
||||
import { getAuthor, getFollowedPubkeys } from '@/queries.ts';
|
||||
import { booleanParamSchema, fileSchema } from '@/schema.ts';
|
||||
@@ -28,10 +27,6 @@ const createAccountSchema = z.object({
|
||||
});
|
||||
|
||||
const createAccountController: AppController = async (c) => {
|
||||
if (!Conf.registrations) {
|
||||
return c.json({ error: 'Registrations are disabled.' }, 403);
|
||||
}
|
||||
|
||||
const pubkey = c.get('pubkey')!;
|
||||
const result = createAccountSchema.safeParse(await c.req.json());
|
||||
|
||||
@@ -39,12 +34,6 @@ const createAccountController: AppController = async (c) => {
|
||||
return c.json({ error: 'Bad request', schema: result.error }, 400);
|
||||
}
|
||||
|
||||
await insertUser({
|
||||
pubkey,
|
||||
inserted_at: new Date(),
|
||||
admin: false,
|
||||
});
|
||||
|
||||
return c.json({
|
||||
access_token: nip19.npubEncode(pubkey),
|
||||
token_type: 'Bearer',
|
||||
|
||||
@@ -18,7 +18,7 @@ const instanceController: AppController = async (c) => {
|
||||
title: meta.name ?? 'Ditto',
|
||||
description: meta.about ?? 'Nostr and the Fediverse',
|
||||
short_description: meta.tagline ?? meta.about ?? 'Nostr and the Fediverse',
|
||||
registrations: Conf.registrations,
|
||||
registrations: true,
|
||||
max_toot_chars: Conf.postCharLimit,
|
||||
configuration: {
|
||||
media_attachments: {
|
||||
|
||||
Reference in New Issue
Block a user