feat: 2FA With FortiToken (#1288)

https://github.com/Termix-SSH/Support/issues/1288
This commit is contained in:
LukeGus committed 2026-09-20 18:16:45 -05:00
1 parent 42e7861073
commit 6ce5e78165
4 files changed
+65 -1

No files matched your search

+12
View File
@@ -40,6 +40,9 @@ export function TOTPDialog({
const isMenu = mode === "menu";
const isTotp = mode === "totp";
const showWaiting = waiting || (isPush && pushSubmitted);
// FortiToken-style prompts ask for a numeric code or the literal word
// "push", so the field can't be restricted to digits only.
const allowsPushKeyword = isTotp && /push/i.test(prompt);
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
@@ -114,6 +117,15 @@ export function TOTPDialog({
placeholder={t("terminal.mfaMenuPlaceholder")}
className="rounded-none bg-muted/50 border-border text-center text-sm tracking-widest"
/>
) : allowsPushKeyword ? (
<Input
id="totpCode"
name="totpCode"
type="text"
autoFocus
placeholder={t("terminal.mfaCodeOrPushPlaceholder")}
className="rounded-none bg-muted/50 border-border text-center text-sm tracking-widest"
/>
) : (
<Input
id="totpCode"