diff --git a/apps/web/components/Form.jsx b/apps/web/components/Form.jsx index f62988d..fa5c969 100644 --- a/apps/web/components/Form.jsx +++ b/apps/web/components/Form.jsx @@ -5,13 +5,11 @@ import Error from 'elements/Error'; import { H3 } from 'elements/H'; import Input from 'elements/Input'; import getConfig from 'next/config'; -import { useRouter } from 'next/router'; import { useState } from 'react'; const { publicRuntimeConfig: config } = getConfig(); export default function Form() { - const router = useRouter(); const [hasError, setHasError] = useState(false); const error = hasError ? Неверный логин или пароль : null; @@ -28,7 +26,11 @@ export default function Form() { axios .post('/signin', data) .then(() => { - router.reload(); + const url = + (window.location.pathname.replace(config.basePath, '') || '/') + + (window.location.search || ''); + + window.location.replace(url); }) .catch(() => { setHasError(true);