@@ -23,26 +23,33 @@ export const LoginTypes = ["email", "phone", "anonymous", "emailLink", "google"]
23
23
export type LoginType = ( typeof LoginTypes ) [ number ] ;
24
24
export type AuthMode = "signIn" | "signUp" ;
25
25
26
- export function createEmailFormSchema ( ui : FirebaseUIConfiguration ) {
26
+ export function createSignInAuthFormSchema ( ui : FirebaseUIConfiguration ) {
27
27
return z . object ( {
28
28
email : z . string ( ) . email ( { message : getTranslation ( ui , "errors" , "invalidEmail" ) } ) ,
29
29
password : z . string ( ) . min ( 8 , { message : getTranslation ( ui , "errors" , "weakPassword" ) } ) ,
30
30
} ) ;
31
31
}
32
32
33
- export function createForgotPasswordFormSchema ( ui : FirebaseUIConfiguration ) {
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
+
40
+ export function createForgotPasswordAuthFormSchema ( ui : FirebaseUIConfiguration ) {
34
41
return z . object ( {
35
42
email : z . string ( ) . email ( { message : getTranslation ( ui , "errors" , "invalidEmail" ) } ) ,
36
43
} ) ;
37
44
}
38
45
39
- export function createEmailLinkFormSchema ( ui : FirebaseUIConfiguration ) {
46
+ export function createEmailLinkAuthFormSchema ( ui : FirebaseUIConfiguration ) {
40
47
return z . object ( {
41
48
email : z . string ( ) . email ( { message : getTranslation ( ui , "errors" , "invalidEmail" ) } ) ,
42
49
} ) ;
43
50
}
44
51
45
- export function createPhoneFormSchema ( ui : FirebaseUIConfiguration ) {
52
+ export function createPhoneAuthFormSchema ( ui : FirebaseUIConfiguration ) {
46
53
return z . object ( {
47
54
phoneNumber : z
48
55
. string ( )
@@ -55,7 +62,8 @@ export function createPhoneFormSchema(ui: FirebaseUIConfiguration) {
55
62
} ) ;
56
63
}
57
64
58
- export type EmailFormSchema = z . infer < ReturnType < typeof createEmailFormSchema > > ;
59
- export type ForgotPasswordFormSchema = z . infer < ReturnType < typeof createForgotPasswordFormSchema > > ;
60
- export type EmailLinkFormSchema = z . infer < ReturnType < typeof createEmailLinkFormSchema > > ;
61
- export type PhoneFormSchema = z . infer < ReturnType < typeof createPhoneFormSchema > > ;
65
+ export type SignInAuthFormSchema = z . infer < ReturnType < typeof createSignInAuthFormSchema > > ;
66
+ export type SignUpAuthFormSchema = z . infer < ReturnType < typeof createSignUpAuthFormSchema > > ;
67
+ export type ForgotPasswordAuthFormSchema = z . infer < ReturnType < typeof createForgotPasswordAuthFormSchema > > ;
68
+ export type EmailLinkAuthFormSchema = z . infer < ReturnType < typeof createEmailLinkAuthFormSchema > > ;
69
+ export type PhoneAuthFormSchema = z . infer < ReturnType < typeof createPhoneAuthFormSchema > > ;
0 commit comments