Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/pages/auth/confirmation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Head from "next/head";
import Link from "next/link";
import Image from "next/image";
import { useRouter } from "next/router";
import { Flex, Text } from "@chakra-ui/react";
Expand All @@ -9,7 +10,7 @@ import { Toast } from "@/components/Toast";
export default function Confirmation() {
const route = useRouter();
const { addToast } = Toast();
const [hasEmail, setHasEmail] = useState(false);
const [hasEmail, setHasEmail] = useState(true);
const hasInitiatedRef = useRef(false);

useEffect(() => {
Expand All @@ -26,11 +27,11 @@ export default function Confirmation() {
message: "Parâmetro de e-mail não encontrado na URL.",
type: "error"
});

return;
}

try {
setHasEmail(true);
hasInitiatedRef.current = true;

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