mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 15:15: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
@@ -123,6 +123,16 @@ export class SSHAuthManager {
|
||||
return;
|
||||
}
|
||||
|
||||
// FortiToken-style prompt: asks the user to type a code OR the literal
|
||||
// word "push" (e.g. "Enter your Token or type 'push' to receive a push
|
||||
// notification:"). Unlike JumpCloud/DUO's confirm-only push, this needs a
|
||||
// text field, so it must not fall into the empty-answerable push pattern
|
||||
// below. Checked first since its text also contains "push notification".
|
||||
const fortiTokenPattern = /type\s+['"]?push['"]?/i;
|
||||
const isFortiTokenPrompt = promptTexts.some((p) =>
|
||||
fortiTokenPattern.test(p),
|
||||
);
|
||||
|
||||
// JumpCloud Protect / DUO-style push MFA: a menu choice ("Choose [1] Push,
|
||||
// or [2] TOTP:") followed by an empty-answerable confirm ("Press enter to
|
||||
// send Push request:"). Checked before the TOTP regex because the menu
|
||||
@@ -130,7 +140,8 @@ export class SSHAuthManager {
|
||||
// misrouted into the numeric-code flow.
|
||||
const pushPromptPattern =
|
||||
/choose.*push.*totp|press enter.*(push|send)|push notification|authentication by phone/i;
|
||||
const isPushPrompt = promptTexts.some((p) => pushPromptPattern.test(p));
|
||||
const isPushPrompt =
|
||||
!isFortiTokenPrompt && promptTexts.some((p) => pushPromptPattern.test(p));
|
||||
|
||||
if (isPushPrompt) {
|
||||
sshLogger.info("Push/menu MFA prompt detected", {
|
||||
|
||||
Reference in new issue
Block a user