(protocol, username, service, method, submethods, cb)
| 83 | |
| 84 | class KeyboardAuthContext extends AuthContext { |
| 85 | constructor(protocol, username, service, method, submethods, cb) { |
| 86 | super(protocol, username, service, method, cb); |
| 87 | |
| 88 | this._multistep = true; |
| 89 | |
| 90 | this._cb = undefined; |
| 91 | this._onInfoResponse = (responses) => { |
| 92 | const callback = this._cb; |
| 93 | if (callback) { |
| 94 | this._cb = undefined; |
| 95 | callback(responses); |
| 96 | } |
| 97 | }; |
| 98 | this.submethods = submethods; |
| 99 | this.on('abort', () => { |
| 100 | this._cb && this._cb(new Error('Authentication request aborted')); |
| 101 | }); |
| 102 | } |
| 103 | |
| 104 | prompt(prompts, title, instructions, cb) { |
| 105 | if (!Array.isArray(prompts)) |
nothing calls this directly
no test coverage detected