import type { authClient } from "../config/client";
import { z } from "zod";

export const passwordModel = z.string().min(6).max(128);

export const authPayloadModel = z.object({
	username: z.string().min(4).max(128),
	password: passwordModel,
});

export type AuthPayloadModel = z.infer<typeof authPayloadModel>;
export type Session = typeof authClient.$Infer.Session;

export const changePasswordPayloadModel = z.object({
	oldPassword: passwordModel,
	newPassword: passwordModel,
});

export type ChangePasswordPayloadModel = z.infer<
	typeof changePasswordPayloadModel
>;
