feat(FN-1899): add login timeout, cancellation, and 409 conflict handling
- Add LoginOutcome type ('pending' | 'success' | 'failed' | 'timeout') with state tracking
- Implement AbortController-based cancellation for OAuth login flows
- Add timeout detection after MAX_POLL_CYCLES (150 polls, ~5 min)
- Handle 409 Conflict when concurrent login is attempted
- Persist login outcomes to onboarding stepData for session recovery
- Add getStepData mock export to App.test.tsx vi.mock
- Fix ToastType: use 'info' instead of invalid 'warning' type
This commit is contained in:
@@ -248,7 +248,7 @@ export function ModelOnboardingModal({
|
||||
}
|
||||
setAuthActionInProgress(null);
|
||||
setLoginOutcomes((prev) => ({ ...prev, [providerId]: "timeout" }));
|
||||
addToast("Login timed out. Please try again.", "warning");
|
||||
addToast("Login timed out. Please try again.", "info");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ export function ModelOnboardingModal({
|
||||
(err && typeof err === "object" && "status" in err && (err as { status: number }).status === 409);
|
||||
|
||||
if (isConcurrentLogin) {
|
||||
addToast("Login already in progress. Please wait or cancel the current attempt.", "warning");
|
||||
addToast("Login already in progress. Please wait or cancel the current attempt.", "info");
|
||||
setLoginOutcomes((prev) => ({ ...prev, [providerId]: "failed" }));
|
||||
} else {
|
||||
addToast(err instanceof Error ? err.message : "Login failed", "error");
|
||||
|
||||
Reference in New Issue
Block a user