Skip to content

Commit 87db1c6

Browse files
authored
Merge pull request #81 from jpcmf/improvement/confirmation-page-2
improvement: Update confirmation component to always set hasEmail and…
2 parents eb43fa5 + e1db0ab commit 87db1c6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pages/auth/confirmation.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Head from "next/head";
2+
import Link from "next/link";
23
import Image from "next/image";
34
import { useRouter } from "next/router";
45
import { Flex, Text } from "@chakra-ui/react";
@@ -9,7 +10,7 @@ import { Toast } from "@/components/Toast";
910
export default function Confirmation() {
1011
const route = useRouter();
1112
const { addToast } = Toast();
12-
const [hasEmail, setHasEmail] = useState(false);
13+
const [hasEmail, setHasEmail] = useState(true);
1314
const hasInitiatedRef = useRef(false);
1415

1516
useEffect(() => {
@@ -26,11 +27,11 @@ export default function Confirmation() {
2627
message: "Parâmetro de e-mail não encontrado na URL.",
2728
type: "error"
2829
});
30+
2931
return;
3032
}
3133

3234
try {
33-
setHasEmail(true);
3435
hasInitiatedRef.current = true;
3536

3637
const response = await fetch("/api/sendConfirmationEmail", {
@@ -111,6 +112,11 @@ export default function Confirmation() {
111112
<Text fontWeight="normal" align="center" color="gray.300" mt="2">
112113
Parâmetro de e-mail não encontrado na URL.
113114
</Text>
115+
<Link href="/">
116+
<Text color="blue.500" align="center" mt="2">
117+
Voltar para a página inicial
118+
</Text>
119+
</Link>
114120
</>
115121
)}
116122
</Flex>

0 commit comments

Comments
 (0)