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:
parent
7e20975cb1
commit
7458fb2e55
5 changed files with 88 additions and 63 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue