1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

refactor login dialog

This commit is contained in:
Fedor Katurov 2023-10-30 17:50:40 +06:00
parent 7e20975cb1
commit 7458fb2e55
5 changed files with 88 additions and 63 deletions

View file

@ -17,7 +17,7 @@ export type LoginFormData = Asserts<typeof validationSchema>;
export const useLoginForm = (
fetcher: (username: string, password: string) => Promise<IUser>,
onSuccess: () => void
onSuccess: () => void,
) => {
const onSubmit = useCallback<FormikConfig<LoginFormData>['onSubmit']>(
async (values, { setErrors }) => {
@ -33,7 +33,7 @@ export const useLoginForm = (
}
}
},
[fetcher, onSuccess]
[fetcher, onSuccess],
);
return useFormik({