mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
security advisory fixes opened by kolega-ai-dev
This commit is contained in:
parent
e5f794c329
commit
8f55ed9da9
7 changed files with 36 additions and 13 deletions
|
|
@ -4,6 +4,7 @@ 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';
|
||||
|
||||
|
|
@ -11,8 +12,8 @@ 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue