From d808aa31951faa5f8b2bf7d8ddd9075761cf785d Mon Sep 17 00:00:00 2001 From: 14790897 <14790897abc@gmail.com> Date: Fri, 8 Mar 2024 19:56:57 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=AF=86=E7=A0=81=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/[lng]/request-reset/page.tsx | 35 ++++++++++++++++++++++++++ app/[lng]/reset-password/page.tsx | 41 +++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 app/[lng]/request-reset/page.tsx create mode 100644 app/[lng]/reset-password/page.tsx diff --git a/app/[lng]/request-reset/page.tsx b/app/[lng]/request-reset/page.tsx new file mode 100644 index 0000000..5ab3eb2 --- /dev/null +++ b/app/[lng]/request-reset/page.tsx @@ -0,0 +1,35 @@ +import { useState } from "react"; +import { supabase } from "@/utils/supabaseClient"; + +const RequestResetPassword = () => { + const [email, setEmail] = useState(""); + + const handleResetPassword = async () => { + const { data, error } = await supabase.auth.api.resetPasswordForEmail( + email, + { + redirectTo: `${window.location.origin}/reset-password`, // 确保这个URL是你重置密码页面的地址 + } + ); + + if (error) { + alert("Error sending password reset email: " + error.message); + } else { + alert("Please check your email for the password reset link"); + } + }; + + return ( +