feat: Add YubiKey OTP support and management features

- Implemented YubiKey OTP settings management in useAccountSecurityActions hook.
- Added API functions for retrieving, saving, and bootstrapping YubiKey OTP credentials.
- Enhanced authentication flow to support multiple two-factor providers, including YubiKey.
- Updated localization files to include new YubiKey-related strings in English, Spanish, Russian, and Chinese.
- Introduced new styles for YubiKey management UI components.
- Created utility functions for YubiKey OTP validation and credential handling.
This commit is contained in:
shuaiplus
2026-07-04 02:49:46 +08:00
parent c7eb6c663d
commit f63b745d05
27 changed files with 1325 additions and 61 deletions
+4 -3
View File
@@ -7,7 +7,7 @@ import { t } from '@/lib/i18n';
interface ConfirmDialogProps {
open: boolean;
title: string;
message: string;
message?: string;
variant?: 'default' | 'warning';
showIcon?: boolean;
confirmText?: string;
@@ -90,6 +90,7 @@ export default function ConfirmDialog(props: ConfirmDialogProps) {
const dialogId = useMemo(() => `confirm-dialog-${++dialogIdCounter}`, []);
const titleId = `${dialogId}-title`;
const messageId = `${dialogId}-message`;
const hasMessage = !!props.message;
const canDismiss = !props.cancelDisabled && !closing;
useEffect(() => {
@@ -193,7 +194,7 @@ export default function ConfirmDialog(props: ConfirmDialogProps) {
role="dialog"
aria-modal="true"
aria-labelledby={titleId}
aria-describedby={messageId}
aria-describedby={hasMessage ? messageId : undefined}
tabIndex={-1}
onKeyDown={handleDialogKeyDown}
onSubmit={(e) => {
@@ -228,7 +229,7 @@ export default function ConfirmDialog(props: ConfirmDialogProps) {
</button>
)}
<h3 id={titleId} className="dialog-title">{props.title}</h3>
<div id={messageId} className={`dialog-message ${props.variant === 'warning' ? 'warning' : ''}`}>{props.message}</div>
{hasMessage && <div id={messageId} className={`dialog-message ${props.variant === 'warning' ? 'warning' : ''}`}>{props.message}</div>}
{props.children}
{!props.hideConfirm && (
<button