added authentication and swagger

This commit is contained in:
Kai Ritthaler 2025-05-09 21:08:38 +02:00 committed by Rudi Regentonne
parent c311e3adda
commit 64c0d79438
8 changed files with 447 additions and 56 deletions

View file

@ -2,14 +2,14 @@
import { z } from "zod";
export const userRegistrationSchema = z.object({
username: z.string(),
username: z.string().regex(/^\S*$/, "Username must not contain spaces"), // No whitespaces allowed,
email: z.string().email(),
password: z.string().min(8),
});
export const userLoginSchema = z.object({
username: z.string(),
password: z.string().min(8),
username: z.string().regex(/^\S*$/, "Username must not contain spaces"), // No whitespaces allowed,
password: z.string(),
});
// DTO-Typen aus den Schemas ableiten
export type UserRegistrationDto = z.infer<typeof userRegistrationSchema>;