Skip to content

Commit

Permalink
feat: copy secret to register otp #551
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Sep 15, 2024
1 parent 745e98d commit cb3599e
Show file tree
Hide file tree
Showing 12 changed files with 455 additions and 387 deletions.
429 changes: 206 additions & 223 deletions api/user/otp.go

Large diffs are not rendered by default.

44 changes: 26 additions & 18 deletions app/src/language/en/app.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ msgstr ""
msgid "2FA"
msgstr ""

#: src/views/preference/components/TOTP.vue:88
#: src/views/preference/components/TOTP.vue:90
msgid "2FA Settings"
msgstr ""

Expand Down Expand Up @@ -259,6 +259,10 @@ msgstr ""
msgid "CADir"
msgstr ""

#: src/views/preference/components/TOTP.vue:150
msgid "Can't scan? Use text key binding"
msgstr ""

#: src/components/ChatGPT/ChatGPT.vue:252
#: src/components/StdDesign/StdDataDisplay/StdBatchEdit.vue:55
#: src/components/StdDesign/StdDataDisplay/StdCurd.vue:253
Expand Down Expand Up @@ -452,11 +456,11 @@ msgstr ""
msgid "Credentials"
msgstr ""

#: src/views/preference/components/TOTP.vue:96
#: src/views/preference/components/TOTP.vue:98
msgid "Current account is enabled 2FA."
msgstr ""

#: src/views/preference/components/TOTP.vue:93
#: src/views/preference/components/TOTP.vue:95
msgid "Current account is not enabled 2FA."
msgstr ""

Expand Down Expand Up @@ -753,12 +757,12 @@ msgstr ""
msgid "Enable %{conf_name} in %{node_name} successfully"
msgstr ""

#: src/views/preference/components/TOTP.vue:122
#: src/views/preference/components/TOTP.vue:124
#, fuzzy
msgid "Enable 2FA"
msgstr "Enabled"

#: src/views/preference/components/TOTP.vue:52
#: src/views/preference/components/TOTP.vue:54
#, fuzzy
msgid "Enable 2FA successfully"
msgstr "Enabled successfully"
Expand Down Expand Up @@ -976,7 +980,7 @@ msgid ""
"ban threshold minutes, the ip will be banned for a period of time."
msgstr ""

#: src/views/preference/components/TOTP.vue:108
#: src/views/preference/components/TOTP.vue:110
msgid ""
"If you lose your mobile phone, you can use the recovery code to reset your "
"2FA."
Expand Down Expand Up @@ -1013,12 +1017,12 @@ msgstr ""
msgid "Initialing core upgrader"
msgstr ""

#: src/views/preference/components/TOTP.vue:144
#: src/views/preference/components/TOTP.vue:157
msgid "Input the code from the app:"
msgstr ""

#: src/components/OTP/OTPAuthorization.vue:49
#: src/views/preference/components/TOTP.vue:157
#: src/views/preference/components/TOTP.vue:170
msgid "Input the recovery code:"
msgstr ""

Expand Down Expand Up @@ -1631,15 +1635,15 @@ msgid "Recovered Successfully"
msgstr "Saved successfully"

#: src/components/OTP/OTPAuthorization.vue:56
#: src/views/preference/components/TOTP.vue:164
#: src/views/preference/components/TOTP.vue:177
msgid "Recovery"
msgstr ""

#: src/views/preference/components/TOTP.vue:101
#: src/views/preference/components/TOTP.vue:103
msgid "Recovery Code"
msgstr ""

#: src/views/preference/components/TOTP.vue:110
#: src/views/preference/components/TOTP.vue:112
msgid "Recovery Code:"
msgstr ""

Expand Down Expand Up @@ -1779,7 +1783,7 @@ msgstr ""
msgid "Reset"
msgstr ""

#: src/views/preference/components/TOTP.vue:130
#: src/views/preference/components/TOTP.vue:132
msgid "Reset 2FA"
msgstr ""

Expand Down Expand Up @@ -1832,14 +1836,18 @@ msgstr "Saved successfully"
msgid "Saved successfully"
msgstr "Saved successfully"

#: src/views/preference/components/TOTP.vue:91
#: src/views/preference/components/TOTP.vue:93
msgid "Scan the QR code with your mobile phone to add the account to the app."
msgstr ""

#: src/views/certificate/DNSChallenge.vue:89
msgid "SDK"
msgstr ""

#: src/views/preference/components/TOTP.vue:149
msgid "Secret has been copied"
msgstr ""

#: src/components/StdDesign/StdDataEntry/components/StdSelector.vue:155
msgid "Selector"
msgstr ""
Expand All @@ -1862,8 +1870,8 @@ msgstr "Send"
#: src/views/environment/BatchUpgrader.vue:57
#: src/views/environment/Environment.vue:15 src/views/other/Install.vue:68
#: src/views/preference/AuthSettings.vue:49
#: src/views/preference/components/TOTP.vue:42
#: src/views/preference/components/TOTP.vue:55
#: src/views/preference/components/TOTP.vue:44
#: src/views/preference/components/TOTP.vue:57
#: src/views/preference/Preference.vue:83 src/views/stream/StreamList.vue:113
#: src/views/stream/StreamList.vue:81 src/views/system/Upgrade.vue:42
msgid "Server error"
Expand Down Expand Up @@ -2112,7 +2120,7 @@ msgstr "Certificate Status"
msgid "The path exists, but the file is not a private key"
msgstr ""

#: src/views/preference/components/TOTP.vue:109
#: src/views/preference/components/TOTP.vue:111
msgid ""
"The recovery code is only displayed once, please save it in a safe place."
msgstr ""
Expand Down Expand Up @@ -2185,7 +2193,7 @@ msgstr ""
msgid "Title"
msgstr ""

#: src/views/preference/components/TOTP.vue:90
#: src/views/preference/components/TOTP.vue:92
msgid ""
"To enable it, you need to install the Google or Microsoft Authenticator app "
"on your mobile phone."
Expand All @@ -2207,7 +2215,7 @@ msgstr ""
msgid "Too many login failed attempts, please try again later"
msgstr ""

#: src/views/preference/components/TOTP.vue:89
#: src/views/preference/components/TOTP.vue:91
msgid ""
"TOTP is a two-factor authentication method that uses a time-based one-time "
"password algorithm."
Expand Down
44 changes: 26 additions & 18 deletions app/src/language/es/app.po
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ msgstr ""
msgid "2FA"
msgstr "2FA"

#: src/views/preference/components/TOTP.vue:88
#: src/views/preference/components/TOTP.vue:90
msgid "2FA Settings"
msgstr "Configuración de 2FA"

Expand Down Expand Up @@ -249,6 +249,10 @@ msgstr "Dir CA"
msgid "CADir"
msgstr "Directorio CA"

#: src/views/preference/components/TOTP.vue:150
msgid "Can't scan? Use text key binding"
msgstr ""

#: src/components/ChatGPT/ChatGPT.vue:252
#: src/components/StdDesign/StdDataDisplay/StdBatchEdit.vue:55
#: src/components/StdDesign/StdDataDisplay/StdCurd.vue:253
Expand Down Expand Up @@ -428,12 +432,12 @@ msgstr "Credencial"
msgid "Credentials"
msgstr "Credenciales"

#: src/views/preference/components/TOTP.vue:96
#: src/views/preference/components/TOTP.vue:98
msgid "Current account is enabled 2FA."
msgstr ""
"La cuenta actual tiene habilitada la autenticación de dos factores (2FA)."

#: src/views/preference/components/TOTP.vue:93
#: src/views/preference/components/TOTP.vue:95
msgid "Current account is not enabled 2FA."
msgstr ""
"La cuenta actual no tiene habilitada la autenticación de dos factores (2FA)."
Expand Down Expand Up @@ -716,11 +720,11 @@ msgstr "Falló el habilitado de %{conf_name} en %{node_name}"
msgid "Enable %{conf_name} in %{node_name} successfully"
msgstr "Habilitado exitoso de %{conf_name} en %{node_name}"

#: src/views/preference/components/TOTP.vue:122
#: src/views/preference/components/TOTP.vue:124
msgid "Enable 2FA"
msgstr "Habilitar 2FA"

#: src/views/preference/components/TOTP.vue:52
#: src/views/preference/components/TOTP.vue:54
msgid "Enable 2FA successfully"
msgstr "Habilitar 2FA exitoso"

Expand Down Expand Up @@ -932,7 +936,7 @@ msgstr ""
"el máximo de intentos en los minutos del umbral de prohibición, la IP será "
"bloqueada por un período de tiempo."

#: src/views/preference/components/TOTP.vue:108
#: src/views/preference/components/TOTP.vue:110
msgid ""
"If you lose your mobile phone, you can use the recovery code to reset your "
"2FA."
Expand Down Expand Up @@ -972,12 +976,12 @@ msgstr "Error de actualización de kernel inicial"
msgid "Initialing core upgrader"
msgstr "Inicializando la actualización del kernel"

#: src/views/preference/components/TOTP.vue:144
#: src/views/preference/components/TOTP.vue:157
msgid "Input the code from the app:"
msgstr "Ingrese el código de la aplicación:"

#: src/components/OTP/OTPAuthorization.vue:49
#: src/views/preference/components/TOTP.vue:157
#: src/views/preference/components/TOTP.vue:170
msgid "Input the recovery code:"
msgstr "Ingrese el código de recuperación:"

Expand Down Expand Up @@ -1575,15 +1579,15 @@ msgid "Recovered Successfully"
msgstr "Recuperado con éxito"

#: src/components/OTP/OTPAuthorization.vue:56
#: src/views/preference/components/TOTP.vue:164
#: src/views/preference/components/TOTP.vue:177
msgid "Recovery"
msgstr "Recuperación"

#: src/views/preference/components/TOTP.vue:101
#: src/views/preference/components/TOTP.vue:103
msgid "Recovery Code"
msgstr "Código de Recuperación"

#: src/views/preference/components/TOTP.vue:110
#: src/views/preference/components/TOTP.vue:112
msgid "Recovery Code:"
msgstr "Código de Recuperación:"

Expand Down Expand Up @@ -1710,7 +1714,7 @@ msgstr "Pedido con parámetros incorrectos"
msgid "Reset"
msgstr "Limpiar"

#: src/views/preference/components/TOTP.vue:130
#: src/views/preference/components/TOTP.vue:132
msgid "Reset 2FA"
msgstr "Restablecer 2FA"

Expand Down Expand Up @@ -1761,7 +1765,7 @@ msgstr "Guardado con éxito"
msgid "Saved successfully"
msgstr "Guardado con éxito"

#: src/views/preference/components/TOTP.vue:91
#: src/views/preference/components/TOTP.vue:93
msgid "Scan the QR code with your mobile phone to add the account to the app."
msgstr ""
"Escanee el código QR con su teléfono móvil para agregar la cuenta a la "
Expand All @@ -1771,6 +1775,10 @@ msgstr ""
msgid "SDK"
msgstr "SDK"

#: src/views/preference/components/TOTP.vue:149
msgid "Secret has been copied"
msgstr ""

#: src/components/StdDesign/StdDataEntry/components/StdSelector.vue:155
msgid "Selector"
msgstr "Seleccionador"
Expand All @@ -1793,8 +1801,8 @@ msgstr "Enviado"
#: src/views/environment/BatchUpgrader.vue:57
#: src/views/environment/Environment.vue:15 src/views/other/Install.vue:68
#: src/views/preference/AuthSettings.vue:49
#: src/views/preference/components/TOTP.vue:42
#: src/views/preference/components/TOTP.vue:55
#: src/views/preference/components/TOTP.vue:44
#: src/views/preference/components/TOTP.vue:57
#: src/views/preference/Preference.vue:83 src/views/stream/StreamList.vue:113
#: src/views/stream/StreamList.vue:81 src/views/system/Upgrade.vue:42
msgid "Server error"
Expand Down Expand Up @@ -2037,7 +2045,7 @@ msgstr "La ruta existe, pero el archivo no es un certificado"
msgid "The path exists, but the file is not a private key"
msgstr "La ruta existe, pero el archivo no es una clave privada"

#: src/views/preference/components/TOTP.vue:109
#: src/views/preference/components/TOTP.vue:111
msgid ""
"The recovery code is only displayed once, please save it in a safe place."
msgstr ""
Expand Down Expand Up @@ -2118,7 +2126,7 @@ msgstr "Consejos"
msgid "Title"
msgstr "Título"

#: src/views/preference/components/TOTP.vue:90
#: src/views/preference/components/TOTP.vue:92
msgid ""
"To enable it, you need to install the Google or Microsoft Authenticator app "
"on your mobile phone."
Expand Down Expand Up @@ -2148,7 +2156,7 @@ msgstr ""
"Demasiados intentos fallidos de inicio de sesión, por favor intente "
"nuevamente más tarde"

#: src/views/preference/components/TOTP.vue:89
#: src/views/preference/components/TOTP.vue:91
msgid ""
"TOTP is a two-factor authentication method that uses a time-based one-time "
"password algorithm."
Expand Down
Loading

0 comments on commit cb3599e

Please sign in to comment.