feat(FN-5595): add oauth relogin banner with validity logger
This merge implements an OAuth relogin banner feature (FN-5595) that displays in the dashboard when OAuth tokens expire. The feature includes a new `OAuthReloginBanner` component with styling and tests, an OAuth validity logger in the engine for tracking token state, and corresponding API route inte Fusion-Task-Id: FN-5595 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> Fusion-Task-Id: FN-5595
This commit is contained in:
@@ -3,7 +3,7 @@ import { ProjectEngine } from "../project-engine.js";
|
||||
import { runtimeLog } from "../logger.js";
|
||||
import { TunnelProcessManager } from "../remote-access/tunnel-process-manager.js";
|
||||
import { NtfyNotifier } from "../notifier.js";
|
||||
import { NotificationService, OAuthExpiryMonitor } from "../notification/index.js";
|
||||
import { NotificationService, OAuthExpiryMonitor, OAuthValidityLogger } from "../notification/index.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
syncInsightExtractionAutomation: vi.fn(),
|
||||
@@ -27,6 +27,8 @@ const mocks = vi.hoisted(() => ({
|
||||
notificationServiceStop: vi.fn(),
|
||||
oauthExpiryMonitorStart: vi.fn(async () => undefined),
|
||||
oauthExpiryMonitorStop: vi.fn(),
|
||||
oauthValidityLoggerStart: vi.fn(async () => undefined),
|
||||
oauthValidityLoggerStop: vi.fn(),
|
||||
runtimeConfigurePrMonitoring: vi.fn(),
|
||||
prHandlerCreateFollowUpTask: vi.fn(async () => undefined),
|
||||
}));
|
||||
@@ -98,6 +100,10 @@ vi.mock("../notification/index.js", () => ({
|
||||
start: mocks.oauthExpiryMonitorStart,
|
||||
stop: mocks.oauthExpiryMonitorStop,
|
||||
})),
|
||||
OAuthValidityLogger: vi.fn().mockImplementation(() => ({
|
||||
start: mocks.oauthValidityLoggerStart,
|
||||
stop: mocks.oauthValidityLoggerStop,
|
||||
})),
|
||||
}));
|
||||
|
||||
vi.mock("../auth-storage.js", () => ({
|
||||
@@ -261,6 +267,8 @@ beforeEach(() => {
|
||||
mocks.notificationServiceStop.mockClear();
|
||||
mocks.oauthExpiryMonitorStart.mockClear();
|
||||
mocks.oauthExpiryMonitorStop.mockClear();
|
||||
mocks.oauthValidityLoggerStart.mockClear();
|
||||
mocks.oauthValidityLoggerStop.mockClear();
|
||||
|
||||
mocks.execFile.mockImplementation((
|
||||
_file: string,
|
||||
|
||||
Reference in New Issue
Block a user