File tree 1 file changed +12
-16
lines changed
docs/src/pages/docs/environments
1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -80,22 +80,18 @@ async function loginAction(data: FormData) {
80
80
const t = await getTranslations (' LoginForm' );
81
81
const values = Object .fromEntries (data );
82
82
83
- const result = await loginFormSchema
84
- .refine (async (credentials ) => loginUser (credentials ), {
85
- message: t (' invalidCredentials' )
86
- })
87
- .safeParseAsync (values , {
88
- errorMap(issue , ctx ) {
89
- const path = issue .path .join (' .' );
90
-
91
- const message = {
92
- email: t (' invalidEmail' )
93
- password : t (' invalidPassword' )
94
- }[path ];
95
-
96
- return {message: message || ctx .defaultError };
97
- }
98
- });
83
+ const result = loginFormSchema .safeParse (values , {
84
+ errorMap(issue , ctx ) {
85
+ const path = issue .path .join (' .' );
86
+
87
+ const message = {
88
+ email: t (' invalidEmail' )
89
+ password : t (' invalidPassword' )
90
+ }[path ];
91
+
92
+ return {message: message || ctx .defaultError };
93
+ }
94
+ });
99
95
100
96
// ...
101
97
}
You can’t perform that action at this time.
0 commit comments