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
+31
View File
@@ -27,6 +27,35 @@ const zhCN: Record<string, string> = {
"txt_passkey_provider_help": "使用兼容 FIDO2 的安全密钥或生物识别验证器。",
"txt_yubico_otp_security_key": "Yubico OTP 安全密钥",
"txt_yubico_otp_security_key_help": "使用 YubiKey 4、5 或 NEO 设备。",
"txt_yubikey_setup_intro": "将 YubiKey 插入计算机的 USB 端口。在下面选择第一个空的 YubiKey 输入字段。触摸 YubiKey 的按钮、保存。",
"txt_yubikey_plug_in": "将 YubiKey 插入计算机的 USB 端口",
"txt_yubikey_select_empty_field": "在下面选择第一个空的 YubiKey 输入字段",
"txt_yubikey_touch_button": "触摸 YubiKey 的按钮、保存",
"txt_yubikey_save_form": "保存",
"txt_yubikey_x": "YubiKey {index}",
"txt_nfc_support": "NFC 支持",
"txt_yubikey_supports_nfc": "我的某个密钥支持 NFC",
"txt_yubikey_supports_nfc_desc": "",
"txt_disable_all_keys": "停用全部密钥",
"txt_yubikeys_updated": "YubiKey 已更新",
"txt_yubikey_update_failed": "更新 YubiKey 失败",
"txt_disable_yubikey_failed": "停用 YubiKey 失败",
"txt_yubikey_disabled": "YubiKey 已停用",
"txt_yubikey_enabled": "YubiKey 已启用。",
"txt_yubikey_config_required": "尚未配置 Yubico 验证",
"txt_yubikey_config_required_help": "请先输入一次 YubiKey OTP。NodeWarden 会自动获取并保存实例级 Client ID 和 Secret key,成功后再进入 YubiKey 设置表单。",
"txt_otp_from_yubikey": "来自 YubiKey 的 OTP",
"txt_please_input_yubikey_otp": "请输入 YubiKey OTP",
"txt_yubikey_verify_failed": "YubiKey 验证失败",
"txt_press_yubikey_to_authenticate": "按下 YubiKey 进行验证。",
"txt_yubikey_auto_configure": "自动获取并保存",
"txt_yubikey_validation_credentials": "Yubico 验证凭据",
"txt_view": "查看",
"txt_yubikey_config_updated": "Yubico 验证凭据已更新",
"txt_yubikey_config_update_failed": "更新 Yubico 验证凭据失败",
"txt_yubikey_auto_config_failed": "获取 Yubico 验证凭据失败",
"txt_yubikey_reconfigure_help": "输入一个新的 OTP,可以重新自动获取并替换当前凭据。",
"txt_yubikey_auto_configure_again": "重新自动获取",
"txt_setting_coming_soon": "即将推出。",
"txt_totp_manage_intro": "扫描二维码或在验证器 App 中输入密钥,然后输入验证码。",
"txt_two_step_recovery_code_warning": "当您无法访问两步登录提供程序时,您的一次性恢复代码可用于停用两步登录。请将其妥善保管。",
@@ -860,6 +889,8 @@ const zhCN: Record<string, string> = {
"txt_scope": "权限范围",
"txt_grant_type": "授权类型",
"txt_refresh": "刷新",
"txt_refresh_status": "刷新状态",
"txt_load_failed": "加载失败",
"txt_refresh_in_seconds_s": "{seconds} 秒后刷新",
"txt_regenerate": "重新生成",
"txt_registration_succeeded_please_sign_in": "注册成功,请登录",