diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1783092..9491957 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,8 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: '@types/node': diff --git a/src/components/forms/login.tsx b/src/components/forms/login.tsx index 3c38190..1e91c63 100644 --- a/src/components/forms/login.tsx +++ b/src/components/forms/login.tsx @@ -37,7 +37,7 @@ export const LoginForm = () => { session.reset(); } } - }, [savedToken, router]); + }, [savedToken, router, session]); return (
@@ -59,7 +59,19 @@ export const LoginForm = () => { 'Content-Type': 'application/json', }, method: 'POST', - }).then(r => r.json()).then(res => { + }).then(r => { + setData({ + isError: false, + }); + if (r.status === 302) { + setData({ + isError: true, + message: 'Invalid credentials', + }); + actions.setSubmitting(false); + } + return r.json(); + }).then(res => { if (res.errors || res.error) { setData({ isError: true,