Skip to content

Commit 6f37dda

Browse files
committed
handle accept token
1 parent 9c052dc commit 6f37dda

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/pg/lib/client.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,13 @@ class Client extends EventEmitter {
223223
async _handleGSSContinue(msg) {
224224
try {
225225
const inToken = msg.inToken
226-
const token = await this.client.step(inToken)
226+
if (inToken === 'oRQwEqADCgEAoQsGCSqGSIb3EgECAg==') { // spnegoNegTokenRespKRBAcceptCompleted - The response on successful authentication always has this header.
227+
return; // negotiation successful, no need to do anything further.
228+
}
227229

230+
const token = await this.client.step(inToken)
228231
// TODO: probably a better way to handle this.
229-
if (token == null) {
232+
if (!token) {
230233
this.emit('error', 'Received null GSSAPI token on continue')
231234
}
232235
const buf = Buffer.from(token, 'base64')

0 commit comments

Comments
 (0)