FN-5698: clear OAuth relogin banner after successful login
Clear OAuth re-login banner entries immediately after provider re-authentication. - add a shared oauth relogin success browser event constant in auth utilities - dispatch relogin success events from Settings and Model Onboarding OAuth success flows - update OAuthReloginBanner to listen for relogin success, optimistically clear matching provider rows, and trigger immediate status refresh - add banner tests covering immediate clearing, refetch behavior, unrelated-provider events, and poll-only behavior - document the immediate-clear behavior in dashboard docs and add a patch changeset for @runfusion/fusion Files changed: .changeset/fn-5698-relogin-banner-auto-clear.md | 5 ++ docs/dashboard-guide.md | 4 + packages/dashboard/app/auth.ts | 1 + .../app/components/ModelOnboardingModal.tsx | 3 +- .../app/components/OAuthReloginBanner.tsx | 70 +++++++++-------- .../dashboard/app/components/SettingsModal.tsx | 3 +- .../__tests__/OAuthReloginBanner.test.tsx | 90 ++++++++++++++++++++++ 7 files changed, 144 insertions(+), 32 deletions(-) Fusion-Task-Id: FN-5698 Fusion-Task-Lineage: 1e2f8055-4f77-4e16-ac15-44891de13f55
This commit is contained in:
@@ -47,7 +47,7 @@ import { AgentProvisioningPolicyEditor } from "./AgentProvisioningPolicyEditor";
|
||||
import { SecretsView } from "./SecretsView";
|
||||
import { applyPresetToSelection, generateUniquePresetId } from "../utils/modelPresets";
|
||||
import { copyTextToClipboard } from "../utils/copyToClipboard";
|
||||
import { appendTokenQuery } from "../auth";
|
||||
import { appendTokenQuery, OAUTH_RELOGIN_SUCCESS_EVENT } from "../auth";
|
||||
import { useConfirm } from "../hooks/useConfirm";
|
||||
import { useMobileKeyboard } from "../hooks/useMobileKeyboard";
|
||||
import { useMobileScrollLock } from "../hooks/useMobileScrollLock";
|
||||
@@ -1295,6 +1295,7 @@ export function SettingsModal({
|
||||
setAuthActionInProgress(null);
|
||||
clearAuthLoginUiState(providerId);
|
||||
addToast("Login successful", "success");
|
||||
window.dispatchEvent(new CustomEvent(OAUTH_RELOGIN_SUCCESS_EVENT, { detail: { providerId } }));
|
||||
scrollSettingsToTop();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user