fix: support steam totp code generation and formatting

Co-authored-by: shuaiplus <100134295+shuaiplus@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andshuaiplus authored and Shuai committed 2026-03-17 11:59:30 +08:00
1 parent 010cda972c
commit b5d58f1aa8
3 files changed
+35 -10

No files matched your search

+3 -1
View File
@@ -18,7 +18,9 @@ const TOTP_RING_CIRCUMFERENCE = 2 * Math.PI * TOTP_RING_RADIUS;
const failedIconHosts = new Set<string>();
function formatTotp(code: string): string {
if (!code || code.length < 6) return code;
if (!code) return code;
if (code.length === 5) return `${code.slice(0, 2)} ${code.slice(2)}`;
if (code.length < 6) return code;
return `${code.slice(0, 3)} ${code.slice(3, 6)}`;
}
@@ -235,7 +235,9 @@ export function maskSecret(value: string): string {
}
export function formatTotp(code: string): string {
if (!code || code.length < 6) return code;
if (!code) return code;
if (code.length === 5) return `${code.slice(0, 2)} ${code.slice(2)}`;
if (code.length < 6) return code;
return `${code.slice(0, 3)} ${code.slice(3, 6)}`;
}