chore: bootstrap monorepo workspace and shared schemas
This commit is contained in:
17
packages/shared/src/auth.schema.ts
Normal file
17
packages/shared/src/auth.schema.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const loginSchema = z.object({
|
||||
username: z.string().trim().min(3).max(64),
|
||||
password: z.string().min(8).max(200),
|
||||
});
|
||||
|
||||
export type LoginInput = z.infer<typeof loginSchema>;
|
||||
|
||||
export const authUserSchema = z.object({
|
||||
id: z.string(),
|
||||
username: z.string(),
|
||||
slug: z.string(),
|
||||
displayName: z.string(),
|
||||
});
|
||||
|
||||
export type AuthUser = z.infer<typeof authUserSchema>;
|
||||
Reference in New Issue
Block a user