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

Method onAuthDecide

lib/server.js:1248–1267  ·  view source on GitHub ↗
(ctx, allowed, methodsLeft, isPartial)

Source from the content-addressed store, hash-verified

1246 });
1247
1248 const onAuthDecide = (ctx, allowed, methodsLeft, isPartial) => {
1249 if (authCtx === ctx && !this.authenticated) {
1250 if (allowed) {
1251 authCtx = undefined;
1252 this.authenticated = true;
1253 proto.authSuccess();
1254 pendingAuths = [];
1255 this.emit('ready');
1256 } else {
1257 proto.authFailure(methodsLeft, isPartial);
1258 if (pendingAuths.length) {
1259 authCtx = pendingAuths.pop();
1260 if (listenerCount(this, 'authentication'))
1261 this.emit('authentication', authCtx);
1262 else
1263 authCtx.reject();
1264 }
1265 }
1266 }
1267 };
1268
1269 function sendReplies() {
1270 while (unsentGlobalRequestsReplies.length > 0

Callers

nothing calls this directly

Calls 3

authSuccessMethod · 0.80
authFailureMethod · 0.80
rejectMethod · 0.45

Tested by

no test coverage detected