diff --git a/src/components/register.tsx b/src/components/register.tsx index 333a642..cfd819c 100644 --- a/src/components/register.tsx +++ b/src/components/register.tsx @@ -65,7 +65,7 @@ const Register = () => { // Only email conflict setModalContent(errorData.email); } else { - setModalContent(errorData.error) + setModalContent(errorData.error || 'An error occurred!') } } else if (response.status == 226) { setModalContent('User with same credentials already exists!'); @@ -84,7 +84,7 @@ const Register = () => { const handleModalClose = () => { setShowModal(false); if (modalContent === 'Verification link has been sent by email!') { - Router.push('https://ca-frontend-ebon.vercel.app/'); + Router.push('/'); } }; @@ -286,7 +286,7 @@ const Register = () => {

{modalContent}