Merge branch 'dev' into fix/3981-login-email-case

This commit is contained in:
Alejandro Gispert authored and GitHub committed 2026-02-22 08:01:26 +01:00
commit 60c0915aa5
545 files changed
+33675 -142714

No files matched your search

+11 -10
View File
@@ -1,18 +1,19 @@
import { z } from "zod";
import { ROLES } from "@/lib/constants";
import { uuid } from "@/lib/crypto";
import { hashPassword } from "@/lib/password";
import { parseRequest } from "@/lib/request";
import { badRequest, json, unauthorized } from "@/lib/response";
import { canCreateUser } from "@/permissions";
import { createUser, getUserByUsername } from "@/queries/prisma";
import { z } from 'zod';
import { ROLES } from '@/lib/constants';
import { uuid } from '@/lib/crypto';
import { hashPassword } from '@/lib/password';
import { parseRequest } from '@/lib/request';
import { badRequest, json, unauthorized } from '@/lib/response';
import { userRoleParam } from '@/lib/schema';
import { canCreateUser } from '@/permissions';
import { createUser, getUserByUsername } from '@/queries/prisma';
export async function POST(request: Request) {
const schema = z.object({
id: z.uuid().optional(),
username: z.string().max(255),
password: z.string(),
role: z.string().regex(/admin|user|view-only/i),
password: z.string().min(8).max(255),
role: userRoleParam,
});
const { auth, body, error } = await parseRequest(request, schema);