MCPcopy Create free account
hub / github.com/mscdex/ssh2 / prompt

Method prompt

lib/server.js:104–131  ·  view source on GitHub ↗
(prompts, title, instructions, cb)

Source from the content-addressed store, hash-verified

102 }
103
104 prompt(prompts, title, instructions, cb) {
105 if (!Array.isArray(prompts))
106 prompts = [ prompts ];
107
108 if (typeof title === 'function') {
109 cb = title;
110 title = instructions = undefined;
111 } else if (typeof instructions === 'function') {
112 cb = instructions;
113 instructions = undefined;
114 } else if (typeof cb !== 'function') {
115 cb = undefined;
116 }
117
118 for (let i = 0; i < prompts.length; ++i) {
119 if (typeof prompts[i] === 'string') {
120 prompts[i] = {
121 prompt: prompts[i],
122 echo: true
123 };
124 }
125 }
126
127 this._cb = cb;
128 this._initialResponse = true;
129
130 this._protocol.authInfoReq(title, instructions, prompts);
131 }
132}
133
134class PKAuthContext extends AuthContext {

Callers 3

connectMethod · 0.80
test-userauth.jsFile · 0.80
server-chat.jsFile · 0.80

Calls 1

authInfoReqMethod · 0.80

Tested by

no test coverage detected