import { ConvexError } from "convex/values"; import { Password } from "@convex-dev/auth/providers/Password"; import type { DataModel } from "./_generated/dataModel"; export default Password({ profile(params, ctx) { return { email: params.email as string, name: params.name as string, }; }, validatePasswordRequirements: (password: string) => { if ( password.length < 8 || !/\d/.test(password) || !/[a-z]/.test(password) || !/[A-Z]/.test(password) ) { throw new ConvexError("Invalid password."); } }, });