chore(deps-dev): bump otplib from 12.0.1 to 13.4.0 in the all-npm-root group (#723)

* chore(deps-dev): bump otplib in the all-npm-root group

Bumps the all-npm-root group with 1 update: [otplib](https://github.com/yeojz/otplib/tree/HEAD/packages/otplib).


Updates `otplib` from 12.0.1 to 13.4.0
- [Release notes](https://github.com/yeojz/otplib/releases)
- [Commits](https://github.com/yeojz/otplib/commits/v13.4.0/packages/otplib)

---
updated-dependencies:
- dependency-name: otplib
  dependency-version: 13.4.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-npm-root
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(e2e): migrate otplib imports to v13 API

The v13 release removed the singleton authenticator export. Switch to
the OTP class with generateSync, passing per-call options.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: SaelixCode <dev@saelix.com>
This commit is contained in:
dependabot[bot]
2026-04-26 16:34:01 -04:00
committed by GitHub
parent ccbf951ca8
commit fdab44fe07
3 changed files with 76 additions and 58 deletions
+4 -10
View File
@@ -8,16 +8,10 @@
* E2E_USERNAME=admin E2E_PASSWORD=mypassword npx playwright test
*/
import { Page, expect } from '@playwright/test';
import { authenticator } from 'otplib';
import { HashAlgorithms } from '@otplib/core';
import { OTP } from 'otplib';
// Match backend configuration so generated codes are accepted.
authenticator.options = {
digits: 6,
step: 30,
algorithm: HashAlgorithms.SHA1,
window: 1,
};
const totp = new OTP({ strategy: 'totp' });
const TOTP_PARAMS = { algorithm: 'sha1' as const, digits: 6, period: 30 };
export const TEST_USERNAME = process.env.E2E_USERNAME ?? 'admin';
export const TEST_PASSWORD = process.env.E2E_PASSWORD ?? 'password123';
@@ -27,7 +21,7 @@ export const TEST_PASSWORD = process.env.E2E_PASSWORD ?? 'password123';
* E2E tests to drive the login challenge without a real authenticator app.
*/
export function totpNow(secret: string): string {
return authenticator.generate(secret.replace(/\s+/g, ''));
return totp.generateSync({ secret: secret.replace(/\s+/g, ''), ...TOTP_PARAMS });
}
/** Selector for the dashboard - only present in EditorLayout, not on login/setup pages */