mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: 2FA With FortiToken (#1288)
https://github.com/Termix-SSH/Support/issues/1288
This commit is contained in:
1 parent
42e7861073
commit
6ce5e78165
4 files changed
+65
-1
No files matched your search
@@ -2182,6 +2182,7 @@
|
||||
"mfaPromptRequired": "Authentication Required",
|
||||
"mfaPushRequired": "Push Authentication Required",
|
||||
"mfaMenuPlaceholder": "Enter your response",
|
||||
"mfaCodeOrPushPlaceholder": "Code or \"push\"",
|
||||
"mfaWaitingApproval": "Waiting for approval on your device...",
|
||||
"mfaSendRequest": "Send Request",
|
||||
"warpgateAuthRequired": "Warpgate Authentication Required",
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user