diff --git a/components/declarations.d.ts b/components/declarations.d.ts new file mode 100644 index 00000000..31e44ff3 --- /dev/null +++ b/components/declarations.d.ts @@ -0,0 +1,2 @@ +declare module '*.css'; +declare module '*.svg'; diff --git a/components/forms/LoginForm.js b/components/forms/LoginForm.js index 894bc9b9..aad3f97d 100644 --- a/components/forms/LoginForm.js +++ b/components/forms/LoginForm.js @@ -1,4 +1,3 @@ -import { useRef } from 'react'; import { useMutation } from '@tanstack/react-query'; import { Form, @@ -20,19 +19,15 @@ export default function LoginForm() { const router = useRouter(); const { post } = useApi(); const { mutate, error, isLoading } = useMutation(data => post('/auth/login', data)); - const ref = useRef(); const handleSubmit = async data => { mutate(data, { - onSuccess: async ({ token, account }) => { + onSuccess: async ({ token, user }) => { setAuthToken(token); - setUser(account); + setUser(user); await router.push('/websites'); }, - onError: async () => { - ref.current.reset(undefined, { keepDirty: true, keepValues: true }); - }, }); }; @@ -44,7 +39,7 @@ export default function LoginForm() {
umami
-