diff --git a/src/features/AuthServiceApp/components/Registration/hooks.tsx b/src/features/AuthServiceApp/components/Registration/hooks.tsx index ea21bb12..ec8df873 100644 --- a/src/features/AuthServiceApp/components/Registration/hooks.tsx +++ b/src/features/AuthServiceApp/components/Registration/hooks.tsx @@ -1,11 +1,14 @@ import { SyntheticEvent, useState } from 'react' +import { useHistory } from 'react-router' import { useAuthFields } from 'features/AuthServiceApp/hooks/useAuthFields' import { registerCheck } from '../../requests/register' import { useParamsUrl } from '../../hooks/useParamsUrl' +import { PAGES } from '../../config/pages' export const useRegistrationForm = () => { + const history = useHistory() const urlParams = useParamsUrl() const [authError, setAuthError] = useState('') const [termsAccepted, setTermsAccepted] = useState(false) @@ -49,6 +52,7 @@ export const useRegistrationForm = () => { const handleModalClose = () => { setIsModalOpen(false) + history.replace(PAGES.login) } const onTermsChange = () => {