added internationalization to pages [WIP]
This commit is contained in:
@@ -2,11 +2,14 @@ import { signOut } from "next-auth/react";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import getServerSideProps from "@/lib/client/getServerSideProps";
|
||||
import { useTranslation } from "next-i18next";
|
||||
|
||||
const VerifyEmail = () => {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const { t } = useTranslation();
|
||||
const token = router.query.token;
|
||||
|
||||
if (!token || typeof token !== "string") {
|
||||
@@ -19,12 +22,12 @@ const VerifyEmail = () => {
|
||||
method: "POST",
|
||||
}).then((res) => {
|
||||
if (res.ok) {
|
||||
toast.success("Email verified. Signing out..");
|
||||
toast.success(t("email_verified_signing_out"));
|
||||
setTimeout(() => {
|
||||
signOut();
|
||||
}, 3000);
|
||||
} else {
|
||||
toast.error("Invalid token.");
|
||||
toast.error(t("invalid_token"));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -35,3 +38,5 @@ const VerifyEmail = () => {
|
||||
};
|
||||
|
||||
export default VerifyEmail;
|
||||
|
||||
export { getServerSideProps };
|
||||
|
||||
Reference in New Issue
Block a user