Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

Revert "fix reset password"

AykutSaracf4d5348a60dc
diff --git a/src/pages/forgot-password.tsx b/src/pages/forgot-password.tsx
index 0f752d1a..7ddaee73 100644
--- a/src/pages/forgot-password.tsx
+++ b/src/pages/forgot-password.tsx
@@ -1,11 +1,11 @@
import React from "react";
import Head from "next/head";
import Link from "next/link";
+import { useRouter } from "next/router";
import { Button, Group, Paper, Stack, TextInput, Text, Anchor, PasswordInput } from "@mantine/core";
import { toast } from "react-hot-toast";
import Layout from "src/layout/Layout";
import { supabase } from "src/lib/api/supabase";
-import useUser from "src/store/useUser";
function ResetPassword() {
const [loading, setLoading] = React.useState(false);
@@ -68,10 +68,11 @@ function ResetPassword() {
}
const ForgotPassword = () => {
- const isAuthenticated = useUser(state => state.isAuthenticated);
+ const { query } = useRouter();
const [loading, setLoading] = React.useState(false);
const [email, setEmail] = React.useState("");
const [success, setSuccess] = React.useState(false);
+ const isPasswordReset = query?.type === "recovery" && !query?.error;
const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
try {
@@ -96,7 +97,7 @@ const ForgotPassword = () => {
<title>Reset Password - JSON Crack</title>
<meta name="robots" content="noindex,nofollow" />
</Head>
- {isAuthenticated ? (
+ {isPasswordReset ? (
<ResetPassword />
) : (
<Paper mx="auto" mt={70} maw={400} p="lg" withBorder>