diff --git a/src/pages/ResetPasswordPage.tsx b/src/pages/ResetPasswordPage.tsx index 6cd152a3..9ca22e7a 100644 --- a/src/pages/ResetPasswordPage.tsx +++ b/src/pages/ResetPasswordPage.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, type FormEvent } from "react"; import { useNavigate } from "react-router-dom"; -import { supabase } from "../supabase-client"; +import { supabase, isBackendAvailable } from "../supabase-client"; import { Lock } from "lucide-react"; import { showSuccess, showError } from "../utils/toast"; @@ -13,6 +13,10 @@ export default function ResetPasswordPage() { const navigate = useNavigate(); useEffect(() => { + if (!isBackendAvailable || !supabase) { + showError("Password reset is unavailable in demo mode or without backend configuration."); + return; + } // Check if we have a valid session from the reset link supabase.auth.getSession().then(({ data: { session } }) => { if (!session) { @@ -36,6 +40,11 @@ export default function ResetPasswordPage() { return; } + if (!isBackendAvailable || !supabase) { + setError("Password reset is unavailable in demo mode or without backend configuration."); + return; + } + setLoading(true); try {