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 (
+
+ setEmail(e.target.value)}
+ />
+
+
+ );
+};
+
+export default RequestResetPassword;
diff --git a/app/[lng]/reset-password/page.tsx b/app/[lng]/reset-password/page.tsx
new file mode 100644
index 0000000..903012b
--- /dev/null
+++ b/app/[lng]/reset-password/page.tsx
@@ -0,0 +1,41 @@
+import { useState } from "react";
+import { supabase } from "@/utils/supabaseClient";
+import { useRouter } from "next/router";
+
+const ResetPassword = () => {
+ const [newPassword, setNewPassword] = useState("");
+ const router = useRouter();
+ const { access_token } = router.query; // 获取URL中的access_token参数
+
+ const handleNewPassword = async () => {
+ if (!access_token) {
+ alert("Token is not provided or invalid");
+ return;
+ }
+
+ const { error } = await supabase.auth.api.updateUser(access_token, {
+ password: newPassword,
+ });
+
+ if (error) {
+ alert("Error resetting password: " + error.message);
+ } else {
+ alert("Your password has been reset successfully");
+ router.push("/login"); // 导航到登录页面或其他页面
+ }
+ };
+
+ return (
+
+ setNewPassword(e.target.value)}
+ />
+
+
+ );
+};
+
+export default ResetPassword;