mirror of
https://github.com/bitwarden/clients.git
synced 2026-02-09 18:34:13 +08:00
feat(auth): [PM-13659] implement 2FA timeout handling across clients
Add timeout state management for two-factor authentication flows in web, desktop, and browser extension clients. Includes: - New timeout screen component with 5-minute session limit - Updated UI elements and styling - Comprehensive test coverage Refs: PM-13659
This commit is contained in:
@@ -86,9 +86,12 @@ describe("TwoFactorComponent", () => {
|
||||
};
|
||||
|
||||
let selectedUserDecryptionOptions: BehaviorSubject<UserDecryptionOptions>;
|
||||
let twoFactorTimeoutSubject: BehaviorSubject<boolean>;
|
||||
|
||||
beforeEach(() => {
|
||||
twoFactorTimeoutSubject = new BehaviorSubject<boolean>(false);
|
||||
mockLoginStrategyService = mock<LoginStrategyServiceAbstraction>();
|
||||
mockLoginStrategyService.twoFactorTimeout$ = twoFactorTimeoutSubject;
|
||||
mockRouter = mock<Router>();
|
||||
mockI18nService = mock<I18nService>();
|
||||
mockApiService = mock<ApiService>();
|
||||
@@ -492,4 +495,10 @@ describe("TwoFactorComponent", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("navigates to the timeout route when timeout expires", async () => {
|
||||
twoFactorTimeoutSubject.next(true);
|
||||
|
||||
expect(mockRouter.navigate).toHaveBeenCalledWith(["2fa-timeout"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user