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 en: Record<string, string> = {
"txt_passkey_provider_help": "Use a FIDO2-compatible security key or biometric authenticator.",
"txt_yubico_otp_security_key": "Yubico OTP security key",
"txt_yubico_otp_security_key_help": "Use a YubiKey 4, 5, or NEO device.",
"txt_yubikey_setup_intro": "Insert your YubiKey into a USB port. Select the first empty YubiKey field below, touch the YubiKey button, then save the form.",
"txt_yubikey_plug_in": "Insert your YubiKey into a USB port.",
"txt_yubikey_select_empty_field": "Select the first empty YubiKey input field below.",
"txt_yubikey_touch_button": "Touch the YubiKey button.",
"txt_yubikey_save_form": "Save the form.",
"txt_yubikey_x": "YubiKey {index}",
"txt_nfc_support": "NFC support",
"txt_yubikey_supports_nfc": "One of my keys supports NFC.",
"txt_yubikey_supports_nfc_desc": "If one of your YubiKeys supports NFC, mobile apps can prompt you when NFC is available.",
"txt_disable_all_keys": "Disable all keys",
"txt_yubikeys_updated": "YubiKeys updated",
"txt_yubikey_update_failed": "Failed to update YubiKeys",
"txt_disable_yubikey_failed": "Failed to disable YubiKeys",
"txt_yubikey_disabled": "YubiKeys disabled",
"txt_yubikey_enabled": "YubiKey is enabled.",
"txt_yubikey_config_required": "Yubico validation is not configured",
"txt_yubikey_config_required_help": "Enter one YubiKey OTP first. NodeWarden will automatically request and save the instance Client ID and Secret key, then open the YubiKey setup form.",
"txt_otp_from_yubikey": "OTP from YubiKey",
"txt_please_input_yubikey_otp": "Please input YubiKey OTP",
"txt_yubikey_verify_failed": "YubiKey verification failed",
"txt_press_yubikey_to_authenticate": "Press your YubiKey to authenticate.",
"txt_yubikey_auto_configure": "Get and save automatically",
"txt_yubikey_validation_credentials": "Yubico validation credentials",
"txt_view": "View",
"txt_yubikey_config_updated": "Yubico validation credentials updated",
"txt_yubikey_config_update_failed": "Failed to update Yubico validation credentials",
"txt_yubikey_auto_config_failed": "Failed to get Yubico validation credentials",
"txt_yubikey_reconfigure_help": "Enter a fresh OTP to request and replace these credentials automatically.",
"txt_yubikey_auto_configure_again": "Get again automatically",
"txt_setting_coming_soon": "Coming soon.",
"txt_totp_manage_intro": "Scan the QR code or enter the key in your authenticator app, then enter the verification code.",
"txt_two_step_recovery_code_warning": "If you cannot access your two-step login provider, your one-time recovery code can be used to disable two-step login. Store the recovery code somewhere safe.",
@@ -860,6 +889,8 @@ const en: Record<string, string> = {
"txt_scope": "scope",
"txt_grant_type": "grant_type",
"txt_refresh": "Refresh",
"txt_refresh_status": "Refresh status",
"txt_load_failed": "Failed to load",
"txt_refresh_in_seconds_s": "Refresh in {seconds}s",
"txt_regenerate": "Regenerate",
"txt_registration_succeeded_please_sign_in": "Registration succeeded. Please sign in.",