mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
feat: don't hide nonsecret kbd-interactive answers
Some Kbd-Interactive challenges are marked with echo true. For these, it makes sense to use a TextField in place of a PasswordField. This change differentiates between the two options.
This commit is contained in:
parent
2a5857bc3d
commit
af22fd38af
@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import { GlobalModel } from "@/models";
|
||||
import { Choose, When, If } from "tsx-control-statements/components";
|
||||
import { Modal, PasswordField, Markdown, Checkbox } from "@/elements";
|
||||
import { Modal, PasswordField, TextField, Markdown, Checkbox } from "@/elements";
|
||||
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "@/util/keyutil";
|
||||
|
||||
import "./userinput.less";
|
||||
@ -82,8 +82,17 @@ export const UserInputModal = (userInputRequest: UserInputRequest) => {
|
||||
</If>
|
||||
<If condition={!userInputRequest.markdown}>{userInputRequest.querytext}</If>
|
||||
</div>
|
||||
<Choose>
|
||||
<When condition={userInputRequest.responsetype == "text"}>
|
||||
<If condition={userInputRequest.responsetype == "text"}>
|
||||
<If condition={userInputRequest.publictext}>
|
||||
<TextField
|
||||
onChange={setResponseText}
|
||||
value={responseText}
|
||||
maxLength={400}
|
||||
autoFocus={true}
|
||||
onKeyDown={(e) => handleTextKeyDown(e)}
|
||||
/>
|
||||
</If>
|
||||
<If condition={!userInputRequest.publictext}>
|
||||
<PasswordField
|
||||
onChange={setResponseText}
|
||||
value={responseText}
|
||||
@ -91,8 +100,8 @@ export const UserInputModal = (userInputRequest: UserInputRequest) => {
|
||||
autoFocus={true}
|
||||
onKeyDown={(e) => handleTextKeyDown(e)}
|
||||
/>
|
||||
</When>
|
||||
</Choose>
|
||||
</If>
|
||||
</If>
|
||||
</div>
|
||||
<If condition={userInputRequest.checkboxmsg != ""}>
|
||||
<Checkbox
|
||||
|
1
src/types/custom.d.ts
vendored
1
src/types/custom.d.ts
vendored
@ -667,6 +667,7 @@ declare global {
|
||||
markdown: boolean;
|
||||
timeoutms: number;
|
||||
checkboxmsg: string;
|
||||
publictext: boolean;
|
||||
};
|
||||
|
||||
type UserInputResponsePacket = {
|
||||
|
@ -230,6 +230,7 @@ func promptChallengeQuestion(connCtx context.Context, question string, echo bool
|
||||
QueryText: queryText,
|
||||
Markdown: true,
|
||||
Title: "Keyboard Interactive Authentication",
|
||||
PublicText: echo,
|
||||
}
|
||||
response, err := userinput.GetUserInput(ctx, scbus.MainRpcBus, request)
|
||||
if err != nil {
|
||||
|
@ -22,6 +22,7 @@ type UserInputRequestType struct {
|
||||
Markdown bool `json:"markdown"`
|
||||
TimeoutMs int `json:"timeoutms"`
|
||||
CheckBoxMsg string `json:"checkboxmsg"`
|
||||
PublicText bool `json:"publictext"`
|
||||
}
|
||||
|
||||
func (*UserInputRequestType) GetType() string {
|
||||
|
Loading…
Reference in New Issue
Block a user