@authagonal/login 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -5
- package/package.json +1 -1
- package/src/i18n/de.json +1 -0
- package/src/i18n/en.json +1 -0
- package/src/i18n/es.json +1 -0
- package/src/i18n/fr.json +1 -0
- package/src/i18n/pt.json +1 -0
- package/src/i18n/tlh.json +1 -0
- package/src/i18n/vi.json +1 -0
- package/src/i18n/zh-Hans.json +1 -0
- package/src/pages/ForgotPasswordPage.tsx +9 -4
- package/src/pages/LoginPage.tsx +1 -1
- package/src/pages/RegisterPage.tsx +1 -1
- package/src/pages/ResetPasswordPage.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -3523,6 +3523,7 @@ var Er = {
|
|
|
3523
3523
|
errorEmailRequired: "Email is required",
|
|
3524
3524
|
errorPasswordRequired: "Password is required",
|
|
3525
3525
|
errorUnexpected: "An unexpected error occurred. Please try again.",
|
|
3526
|
+
captchaFailed: "Verification failed. Please try again.",
|
|
3526
3527
|
resetYourPassword: "Reset your password",
|
|
3527
3528
|
resetSubtitle: "Enter your email address and we'll send you a link to reset your password.",
|
|
3528
3529
|
sending: "Sending...",
|
|
@@ -3656,6 +3657,7 @@ var Er = {
|
|
|
3656
3657
|
errorEmailRequired: "电子邮件为必填项",
|
|
3657
3658
|
errorPasswordRequired: "密码为必填项",
|
|
3658
3659
|
errorUnexpected: "发生意外错误,请重试。",
|
|
3660
|
+
captchaFailed: "验证失败,请重试。",
|
|
3659
3661
|
resetYourPassword: "重置密码",
|
|
3660
3662
|
resetSubtitle: "输入您的电子邮件地址,我们将向您发送重置密码的链接。",
|
|
3661
3663
|
sending: "正在发送...",
|
|
@@ -3766,6 +3768,7 @@ var Er = {
|
|
|
3766
3768
|
errorEmailRequired: "E-Mail ist erforderlich",
|
|
3767
3769
|
errorPasswordRequired: "Passwort ist erforderlich",
|
|
3768
3770
|
errorUnexpected: "Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",
|
|
3771
|
+
captchaFailed: "Verifizierung fehlgeschlagen. Bitte versuchen Sie es erneut.",
|
|
3769
3772
|
resetYourPassword: "Passwort zurücksetzen",
|
|
3770
3773
|
resetSubtitle: "Geben Sie Ihre E-Mail-Adresse ein und wir senden Ihnen einen Link zum Zurücksetzen Ihres Passworts.",
|
|
3771
3774
|
sending: "Wird gesendet...",
|
|
@@ -3876,6 +3879,7 @@ var Er = {
|
|
|
3876
3879
|
errorEmailRequired: "L'e-mail est requis",
|
|
3877
3880
|
errorPasswordRequired: "Le mot de passe est requis",
|
|
3878
3881
|
errorUnexpected: "Une erreur inattendue s'est produite. Veuillez réessayer.",
|
|
3882
|
+
captchaFailed: "Échec de la vérification. Veuillez réessayer.",
|
|
3879
3883
|
resetYourPassword: "Réinitialiser votre mot de passe",
|
|
3880
3884
|
resetSubtitle: "Entrez votre adresse e-mail et nous vous enverrons un lien pour réinitialiser votre mot de passe.",
|
|
3881
3885
|
sending: "Envoi en cours...",
|
|
@@ -3986,6 +3990,7 @@ var Er = {
|
|
|
3986
3990
|
errorEmailRequired: "El correo electrónico es obligatorio",
|
|
3987
3991
|
errorPasswordRequired: "La contraseña es obligatoria",
|
|
3988
3992
|
errorUnexpected: "Se produjo un error inesperado. Por favor, inténtelo de nuevo.",
|
|
3993
|
+
captchaFailed: "Error de verificación. Inténtalo de nuevo.",
|
|
3989
3994
|
resetYourPassword: "Restablecer su contraseña",
|
|
3990
3995
|
resetSubtitle: "Ingrese su dirección de correo electrónico y le enviaremos un enlace para restablecer su contraseña.",
|
|
3991
3996
|
sending: "Enviando...",
|
|
@@ -4096,6 +4101,7 @@ var Er = {
|
|
|
4096
4101
|
errorEmailRequired: "Email là bắt buộc",
|
|
4097
4102
|
errorPasswordRequired: "Mật khẩu là bắt buộc",
|
|
4098
4103
|
errorUnexpected: "Đã xảy ra lỗi không mong muốn. Vui lòng thử lại.",
|
|
4104
|
+
captchaFailed: "Xác minh không thành công. Vui lòng thử lại.",
|
|
4099
4105
|
resetYourPassword: "Đặt lại mật khẩu",
|
|
4100
4106
|
resetSubtitle: "Nhập địa chỉ email của bạn và chúng tôi sẽ gửi cho bạn liên kết để đặt lại mật khẩu.",
|
|
4101
4107
|
sending: "Đang gửi...",
|
|
@@ -4206,6 +4212,7 @@ var Er = {
|
|
|
4206
4212
|
errorEmailRequired: "O e-mail é obrigatório",
|
|
4207
4213
|
errorPasswordRequired: "A senha é obrigatória",
|
|
4208
4214
|
errorUnexpected: "Ocorreu um erro inesperado. Tente novamente.",
|
|
4215
|
+
captchaFailed: "Falha na verificação. Tente novamente.",
|
|
4209
4216
|
resetYourPassword: "Redefinir a sua senha",
|
|
4210
4217
|
resetSubtitle: "Introduza o seu endereço de e-mail e enviaremos um link para redefinir a sua senha.",
|
|
4211
4218
|
sending: "A enviar...",
|
|
@@ -4316,6 +4323,7 @@ var Er = {
|
|
|
4316
4323
|
errorEmailRequired: "QIn nab nIteb nISlu'",
|
|
4317
4324
|
errorPasswordRequired: "mu'wIj pegh nIteb nISlu'",
|
|
4318
4325
|
errorUnexpected: "Qagh qaS. yInIDqa'.",
|
|
4326
|
+
captchaFailed: "ngu' luj. yInIDqa'.",
|
|
4319
4327
|
resetYourPassword: "mu'wIj pegh yIchoH",
|
|
4320
4328
|
resetSubtitle: "QIn nab yIngu'. mu'wIj pegh choHmeH lIngwI' DangeH.",
|
|
4321
4329
|
sending: "ngeHmeH...",
|
|
@@ -4968,7 +4976,7 @@ function _i() {
|
|
|
4968
4976
|
C(e("errorPasswordRequired"));
|
|
4969
4977
|
break;
|
|
4970
4978
|
case "captcha_failed":
|
|
4971
|
-
C(e("
|
|
4979
|
+
C(e("captchaFailed"));
|
|
4972
4980
|
break;
|
|
4973
4981
|
default: C(t.message || e("errorUnexpected"));
|
|
4974
4982
|
}
|
|
@@ -5208,7 +5216,7 @@ function vi() {
|
|
|
5208
5216
|
b(e("errorEmailAndPasswordRequired"));
|
|
5209
5217
|
break;
|
|
5210
5218
|
case "captcha_failed":
|
|
5211
|
-
b(e("
|
|
5219
|
+
b(e("captchaFailed"));
|
|
5212
5220
|
break;
|
|
5213
5221
|
default: b(t.message || e("errorRegistrationFailed"));
|
|
5214
5222
|
}
|
|
@@ -5339,8 +5347,8 @@ function yi() {
|
|
|
5339
5347
|
t.preventDefault(), h(""), c(!0);
|
|
5340
5348
|
try {
|
|
5341
5349
|
await Zr(r, y || void 0), p(!0);
|
|
5342
|
-
} catch {
|
|
5343
|
-
h(e("errorUnexpected")), g && (b(null), S((e) => e + 1));
|
|
5350
|
+
} catch (t) {
|
|
5351
|
+
t instanceof Kr && t.error === "captcha_failed" ? h(e("captchaFailed")) : h(e("errorUnexpected")), g && (b(null), S((e) => e + 1));
|
|
5344
5352
|
} finally {
|
|
5345
5353
|
c(!1);
|
|
5346
5354
|
}
|
|
@@ -5512,7 +5520,7 @@ function Ci() {
|
|
|
5512
5520
|
h(e("errorPasswordRequired"));
|
|
5513
5521
|
break;
|
|
5514
5522
|
case "captcha_failed":
|
|
5515
|
-
h(e("
|
|
5523
|
+
h(e("captchaFailed"));
|
|
5516
5524
|
break;
|
|
5517
5525
|
default: h(t.message || e("errorUnexpected"));
|
|
5518
5526
|
}
|
package/package.json
CHANGED
package/src/i18n/de.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "E-Mail ist erforderlich",
|
|
17
17
|
"errorPasswordRequired": "Passwort ist erforderlich",
|
|
18
18
|
"errorUnexpected": "Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",
|
|
19
|
+
"captchaFailed": "Verifizierung fehlgeschlagen. Bitte versuchen Sie es erneut.",
|
|
19
20
|
"resetYourPassword": "Passwort zurücksetzen",
|
|
20
21
|
"resetSubtitle": "Geben Sie Ihre E-Mail-Adresse ein und wir senden Ihnen einen Link zum Zurücksetzen Ihres Passworts.",
|
|
21
22
|
"sending": "Wird gesendet...",
|
package/src/i18n/en.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "Email is required",
|
|
17
17
|
"errorPasswordRequired": "Password is required",
|
|
18
18
|
"errorUnexpected": "An unexpected error occurred. Please try again.",
|
|
19
|
+
"captchaFailed": "Verification failed. Please try again.",
|
|
19
20
|
"resetYourPassword": "Reset your password",
|
|
20
21
|
"resetSubtitle": "Enter your email address and we'll send you a link to reset your password.",
|
|
21
22
|
"sending": "Sending...",
|
package/src/i18n/es.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "El correo electrónico es obligatorio",
|
|
17
17
|
"errorPasswordRequired": "La contraseña es obligatoria",
|
|
18
18
|
"errorUnexpected": "Se produjo un error inesperado. Por favor, inténtelo de nuevo.",
|
|
19
|
+
"captchaFailed": "Error de verificación. Inténtalo de nuevo.",
|
|
19
20
|
"resetYourPassword": "Restablecer su contraseña",
|
|
20
21
|
"resetSubtitle": "Ingrese su dirección de correo electrónico y le enviaremos un enlace para restablecer su contraseña.",
|
|
21
22
|
"sending": "Enviando...",
|
package/src/i18n/fr.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "L'e-mail est requis",
|
|
17
17
|
"errorPasswordRequired": "Le mot de passe est requis",
|
|
18
18
|
"errorUnexpected": "Une erreur inattendue s'est produite. Veuillez réessayer.",
|
|
19
|
+
"captchaFailed": "Échec de la vérification. Veuillez réessayer.",
|
|
19
20
|
"resetYourPassword": "Réinitialiser votre mot de passe",
|
|
20
21
|
"resetSubtitle": "Entrez votre adresse e-mail et nous vous enverrons un lien pour réinitialiser votre mot de passe.",
|
|
21
22
|
"sending": "Envoi en cours...",
|
package/src/i18n/pt.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "O e-mail é obrigatório",
|
|
17
17
|
"errorPasswordRequired": "A senha é obrigatória",
|
|
18
18
|
"errorUnexpected": "Ocorreu um erro inesperado. Tente novamente.",
|
|
19
|
+
"captchaFailed": "Falha na verificação. Tente novamente.",
|
|
19
20
|
"resetYourPassword": "Redefinir a sua senha",
|
|
20
21
|
"resetSubtitle": "Introduza o seu endereço de e-mail e enviaremos um link para redefinir a sua senha.",
|
|
21
22
|
"sending": "A enviar...",
|
package/src/i18n/tlh.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "QIn nab nIteb nISlu'",
|
|
17
17
|
"errorPasswordRequired": "mu'wIj pegh nIteb nISlu'",
|
|
18
18
|
"errorUnexpected": "Qagh qaS. yInIDqa'.",
|
|
19
|
+
"captchaFailed": "ngu' luj. yInIDqa'.",
|
|
19
20
|
"resetYourPassword": "mu'wIj pegh yIchoH",
|
|
20
21
|
"resetSubtitle": "QIn nab yIngu'. mu'wIj pegh choHmeH lIngwI' DangeH.",
|
|
21
22
|
"sending": "ngeHmeH...",
|
package/src/i18n/vi.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"errorEmailRequired": "Email là bắt buộc",
|
|
17
17
|
"errorPasswordRequired": "Mật khẩu là bắt buộc",
|
|
18
18
|
"errorUnexpected": "Đã xảy ra lỗi không mong muốn. Vui lòng thử lại.",
|
|
19
|
+
"captchaFailed": "Xác minh không thành công. Vui lòng thử lại.",
|
|
19
20
|
"resetYourPassword": "Đặt lại mật khẩu",
|
|
20
21
|
"resetSubtitle": "Nhập địa chỉ email của bạn và chúng tôi sẽ gửi cho bạn liên kết để đặt lại mật khẩu.",
|
|
21
22
|
"sending": "Đang gửi...",
|
package/src/i18n/zh-Hans.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { useSearchParams, Link } from 'react-router-dom';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { forgotPassword, getProviders } from '../api';
|
|
4
|
+
import { forgotPassword, getProviders, ApiRequestError } from '../api';
|
|
5
5
|
import { Turnstile } from '../components/Turnstile';
|
|
6
6
|
import { Button } from '@/components/ui/button';
|
|
7
7
|
import { Input } from '@/components/ui/input';
|
|
@@ -41,9 +41,14 @@ export default function ForgotPasswordPage() {
|
|
|
41
41
|
try {
|
|
42
42
|
await forgotPassword(email, turnstileToken || undefined);
|
|
43
43
|
setSubmitted(true);
|
|
44
|
-
} catch {
|
|
45
|
-
// The API always returns 200 for anti-enumeration
|
|
46
|
-
|
|
44
|
+
} catch (err) {
|
|
45
|
+
// The API always returns 200 for anti-enumeration; the only expected error is a
|
|
46
|
+
// failed captcha (handled explicitly), otherwise a generic message.
|
|
47
|
+
if (err instanceof ApiRequestError && err.error === 'captcha_failed') {
|
|
48
|
+
setError(t('captchaFailed'));
|
|
49
|
+
} else {
|
|
50
|
+
setError(t('errorUnexpected'));
|
|
51
|
+
}
|
|
47
52
|
// Turnstile tokens are single-use — reset so a retry gets a fresh challenge.
|
|
48
53
|
if (turnstileSiteKey) {
|
|
49
54
|
setTurnstileToken(null);
|
package/src/pages/LoginPage.tsx
CHANGED
|
@@ -224,7 +224,7 @@ export default function LoginPage() {
|
|
|
224
224
|
setError(t('errorPasswordRequired'));
|
|
225
225
|
break;
|
|
226
226
|
case 'captcha_failed':
|
|
227
|
-
setError(t('
|
|
227
|
+
setError(t('captchaFailed'));
|
|
228
228
|
break;
|
|
229
229
|
default:
|
|
230
230
|
setError(err.message || t('errorUnexpected'));
|
|
@@ -70,7 +70,7 @@ export default function RegisterPage() {
|
|
|
70
70
|
setError(t('errorEmailAndPasswordRequired'));
|
|
71
71
|
break;
|
|
72
72
|
case 'captcha_failed':
|
|
73
|
-
setError(t('
|
|
73
|
+
setError(t('captchaFailed'));
|
|
74
74
|
break;
|
|
75
75
|
default:
|
|
76
76
|
setError(err.message || t('errorRegistrationFailed'));
|
|
@@ -129,7 +129,7 @@ export default function ResetPasswordPage() {
|
|
|
129
129
|
setError(t('errorPasswordRequired'));
|
|
130
130
|
break;
|
|
131
131
|
case 'captcha_failed':
|
|
132
|
-
setError(t('
|
|
132
|
+
setError(t('captchaFailed'));
|
|
133
133
|
break;
|
|
134
134
|
default:
|
|
135
135
|
setError(err.message || t('errorUnexpected'));
|