From 589035f4b2fea7092bcbc2ba90dd3e959014c0ac Mon Sep 17 00:00:00 2001 From: Karela King Date: Wed, 28 Jan 2026 21:31:29 +0530 Subject: [PATCH 1/2] Fix #180: null safety violation in ResetPasswordPage by adding backend availability checks --- src/pages/ResetPasswordPage.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/ResetPasswordPage.tsx b/src/pages/ResetPasswordPage.tsx index 6cd152a3..b46c8323 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) { @@ -39,6 +43,10 @@ export default function ResetPasswordPage() { setLoading(true); try { + if (!isBackendAvailable || !supabase) { + setError("Password reset is unavailable in demo mode or without backend configuration."); + return; + } const { error } = await supabase.auth.updateUser({ password: password, }); From 0d6219120e1f777b11d22e863560ba4698a1722c Mon Sep 17 00:00:00 2001 From: MRADUL KUMAR KATIYAR <87556435+Karelaking@users.noreply.github.com> Date: Wed, 28 Jan 2026 21:49:17 +0530 Subject: [PATCH 2/2] Update src/pages/ResetPasswordPage.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/pages/ResetPasswordPage.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/ResetPasswordPage.tsx b/src/pages/ResetPasswordPage.tsx index b46c8323..9ca22e7a 100644 --- a/src/pages/ResetPasswordPage.tsx +++ b/src/pages/ResetPasswordPage.tsx @@ -40,13 +40,14 @@ export default function ResetPasswordPage() { return; } + if (!isBackendAvailable || !supabase) { + setError("Password reset is unavailable in demo mode or without backend configuration."); + return; + } + setLoading(true); try { - if (!isBackendAvailable || !supabase) { - setError("Password reset is unavailable in demo mode or without backend configuration."); - return; - } const { error } = await supabase.auth.updateUser({ password: password, });