From fe68afccdce50aa4d2b0e1e201c9058b5f378fca Mon Sep 17 00:00:00 2001 From: nevainero Date: Tue, 5 Apr 2022 12:03:05 +0300 Subject: [PATCH] feat(ott-2272): add redirect on login page after registration --- src/features/AuthServiceApp/components/Registration/hooks.tsx | 4 ++++ 1 file changed, 4 insertions(+) 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 = () => {