diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-08-18 14:15:36 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2022-08-18 16:24:45 +0200 |
commit | 05d68e118d9bdb429ca1da49accbb098afd91523 (patch) | |
tree | f3542c59d02243b61d7cb323c937db1e926c2969 /core | |
parent | 8a7089c0c68f18bb0dde29cd7b0422ef31421a21 (diff) | |
download | novnc-05d68e118d9bdb429ca1da49accbb098afd91523.tar.gz |
Abstract resuming the authentication
We now do this in multiple places, so make sure things are handled the
same way in all cases.
Diffstat (limited to 'core')
-rw-r--r-- | core/rfb.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/rfb.js b/core/rfb.js index 578a898..18b1915 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -402,7 +402,7 @@ export default class RFB extends EventTargetMixin { sendCredentials(creds) { this._rfbCredentials = creds; - setTimeout(this._initMsg.bind(this), 0); + this._resumeAuthentication(); } sendCtrlAltDel() { @@ -1661,7 +1661,7 @@ export default class RFB extends EventTargetMixin { this._rfbCredentials.ardCredentials = encrypted; this._rfbCredentials.ardPublicKey = clientPublicKey; - setTimeout(this._initMsg.bind(this), 0); + this._resumeAuthentication(); } _negotiateTightUnixAuth() { @@ -2052,6 +2052,14 @@ export default class RFB extends EventTargetMixin { } } + // Resume authentication handshake after it was paused for some + // reason, e.g. waiting for a password from the user + _resumeAuthentication() { + // We use setTimeout() so it's run in its own context, just like + // it originally did via the WebSocket's event handler + setTimeout(this._initMsg.bind(this), 0); + } + _handleSetColourMapMsg() { Log.Debug("SetColorMapEntries"); |