Skip to content

Commit 1b41b1f

Browse files
committed
feat(core): Support createSignUpAuthFormSchema
1 parent a505368 commit 1b41b1f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/core/src/schemas.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ export function createSignInAuthFormSchema(ui: FirebaseUIConfiguration) {
3030
});
3131
}
3232

33+
export function createSignUpAuthFormSchema(ui: FirebaseUIConfiguration) {
34+
return z.object({
35+
email: z.string().email({ message: getTranslation(ui, "errors", "invalidEmail") }),
36+
password: z.string().min(8, { message: getTranslation(ui, "errors", "weakPassword") }),
37+
});
38+
}
39+
3340
export function createForgotPasswordAuthFormSchema(ui: FirebaseUIConfiguration) {
3441
return z.object({
3542
email: z.string().email({ message: getTranslation(ui, "errors", "invalidEmail") }),
@@ -56,6 +63,7 @@ export function createPhoneFormSchema(ui: FirebaseUIConfiguration) {
5663
}
5764

5865
export type SignInAuthFormSchema = z.infer<ReturnType<typeof createSignInAuthFormSchema>>;
66+
export type SignUpAuthFormSchema = z.infer<ReturnType<typeof createSignUpAuthFormSchema>>;
5967
export type ForgotPasswordAuthFormSchema = z.infer<ReturnType<typeof createForgotPasswordAuthFormSchema>>;
6068
export type EmailLinkFormSchema = z.infer<ReturnType<typeof createEmailLinkFormSchema>>;
6169
export type PhoneFormSchema = z.infer<ReturnType<typeof createPhoneFormSchema>>;

0 commit comments

Comments
 (0)