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 <noreply@anthropic.com>
This commit is contained in:
committed by
Adolfo R. Brandes
parent
e52d3d89fd
commit
8dcf55254e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user