This commit is contained in:
k
2026-09-21 16:16:47 +02:00
parent f46a6b4412
commit b357d89d81
3 changed files with 10 additions and 9 deletions
+4 -4
View File
@@ -70,7 +70,7 @@ export function Login({ onLogin }: { onLogin: (user: UserType) => void }) {
setToken(res.token);
onLogin(res.user);
} catch (err) {
setError(err instanceof Error ? err.message : "Invalid code");
setError(err instanceof Error ? err.message : t("login.totpInvalid"));
} finally {
setBusy(false);
}
@@ -100,7 +100,7 @@ export function Login({ onLogin }: { onLogin: (user: UserType) => void }) {
onChange={(e) => setCode(e.target.value.replace(/\D/g, "").slice(0, 6))}
autoComplete="one-time-code"
placeholder="000000"
aria-label="Authenticator code"
aria-label={t("login.totpAria")}
inputMode="numeric"
required
/>
@@ -111,14 +111,14 @@ export function Login({ onLogin }: { onLogin: (user: UserType) => void }) {
</p>
)}
<Button type="submit" variant="gradient" size="lg" className="w-full" disabled={busy || code.length !== 6}>
{busy ? <Spinner /> : (<>Verify <ArrowRight size={17} /></>)}
{busy ? <Spinner /> : (<>{t("login.verify")} <ArrowRight size={17} /></>)}
</Button>
<button
type="button"
onClick={() => { setTotpToken(null); setCode(""); setError(""); }}
className="w-full text-center text-sm opacity-60 transition hover:opacity-100 hover:underline"
>
Back to login
{t("common.backToLogin")}
</button>
</form>
) : (
-3
View File
@@ -891,7 +891,4 @@ function SecuritySection({ onKeyRotated }: { onKeyRotated?: () => void }) {
/>
</div>
);
}
</div>
);
}
+6 -2
View File
@@ -1532,8 +1532,12 @@ const pt: Dict = {
"login.forgot": "Esqueceste a chave?",
"login.perk1": "Privado por design — sem cookies nem rastreio",
"login.perk2": "Os teus modelos, em tempo real",
"login.adminNote":
"A chave admin vive no .env do servidor; as chaves são emitidas pelo admin.",
"login.adminNotePre": "A chave admin vive no .env do servidor",
"login.adminNotePost": "; as chaves são emitidas pelo admin.",
"login.totpIntro": "Dois fatores para @{user} — escreve o código de 6 dígitos da app.",
"login.totpAria": "Código do autenticador",
"login.totpInvalid": "Código inválido",
"login.verify": "Verificar",
"sidebar.newChat": "Novo chat",
"sidebar.collapse": "Ocultar barra lateral",