AI Implementation feature(823): Landing Page and Login/Register Modal (#11)
This commit was merged in pull request #11.
This commit is contained in:
@@ -16,6 +16,22 @@ export const CsrfResponseDtoSchema = z.object({
|
||||
});
|
||||
export type CsrfResponseDto = z.infer<typeof CsrfResponseDtoSchema>;
|
||||
|
||||
export const RegisterDtoSchema = z
|
||||
.object({
|
||||
username: z
|
||||
.string()
|
||||
.min(3)
|
||||
.max(32)
|
||||
.regex(/^[a-zA-Z0-9_.-]+$/, 'Username may only contain letters, digits, dot, dash and underscore'),
|
||||
password: z.string().min(1).max(256),
|
||||
passwordConfirm: z.string().min(1).max(256),
|
||||
})
|
||||
.refine((d) => d.password === d.passwordConfirm, {
|
||||
path: ['passwordConfirm'],
|
||||
message: 'Passwords do not match',
|
||||
});
|
||||
export type RegisterDto = z.infer<typeof RegisterDtoSchema>;
|
||||
|
||||
export interface LoginResponse {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
|
||||
Reference in New Issue
Block a user