diff --git a/src/components/VerifyEmail/VerifyEmail.tsx b/src/components/VerifyEmail/VerifyEmail.tsx index 3487a8c8..78ab10cb 100644 --- a/src/components/VerifyEmail/VerifyEmail.tsx +++ b/src/components/VerifyEmail/VerifyEmail.tsx @@ -2,13 +2,18 @@ import {useMutation} from '@tanstack/react-query' import axios from 'axios' import {useRouter} from 'next/router' import {FC, useEffect} from 'react' + import {LoginForm} from '../PageLayout/LoginForm/LoginForm' export const VerifyEmail: FC = () => { const router = useRouter() const {verificationKey} = router.query - const {mutate: verifyEmail, isError: isError, isSuccess: isVerified} = useMutation({ + const { + mutate: verifyEmail, + isError: isError, + isSuccess: isVerified, + } = useMutation({ mutationFn: (verificationKey: string) => axios.post('/api/user/registration/verify-email', {key: verificationKey}), }) @@ -16,20 +21,17 @@ export const VerifyEmail: FC = () => { typeof verificationKey === 'string' && verifyEmail(verificationKey) }, [verificationKey, verifyEmail]) - - - - if (isError) - return <>I am a temporary email verification error. Please put me out of my misery. - + if (isError) return <>I am a temporary email verification error. Please put me out of my misery. else if (isVerified) return ( <>

Pre dokončenie overenia emailu sa prihláste

- { router.push("/") }}/> + { + router.push('/') + }} + /> ) - - else - return <>Loading... + else return <>Loading... }