From 8dcf55254ef72dc6aad52ee75105022564244de9 Mon Sep 17 00:00:00 2001 From: "Adolfo R. Brandes" Date: Fri, 6 Mar 2026 19:29:33 -0300 Subject: [PATCH] fix: call setThirdPartyAuthContextBegin only on mount in LoginPage It was being called on every data sync effect run, causing a flash of PENDING state even when TPA data was already available. Co-Authored-By: Claude Opus 4.6 --- src/login/LoginPage.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index 4ee990df..839f955c 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -100,11 +100,11 @@ const LoginPage = ({ useEffect(() => { sendPageEvent('login_and_registration', 'login'); - }, []); - - // Fetch third-party auth context data - useEffect(() => { setThirdPartyAuthContextBegin(); + }, []); // eslint-disable-line react-hooks/exhaustive-deps + + // Sync third-party auth context data + useEffect(() => { if (isSuccess && data) { setThirdPartyAuthContextSuccess( data.fieldDescriptions, @@ -116,7 +116,7 @@ const LoginPage = ({ setThirdPartyAuthContextFailure(); } }, [tpaHint, queryParams, isSuccess, data, error, - setThirdPartyAuthContextBegin, setThirdPartyAuthContextSuccess, setThirdPartyAuthContextFailure]); + setThirdPartyAuthContextSuccess, setThirdPartyAuthContextFailure]); useEffect(() => { if (thirdPartyErrorMessage) {