Skip to content

Commit

Permalink
handle accept token
Browse files Browse the repository at this point in the history
  • Loading branch information
albertchang committed Jun 27, 2024
1 parent 9c052dc commit 6f37dda
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/pg/lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,13 @@ class Client extends EventEmitter {
async _handleGSSContinue(msg) {
try {
const inToken = msg.inToken
const token = await this.client.step(inToken)
if (inToken === 'oRQwEqADCgEAoQsGCSqGSIb3EgECAg==') { // spnegoNegTokenRespKRBAcceptCompleted - The response on successful authentication always has this header.
return; // negotiation successful, no need to do anything further.
}

const token = await this.client.step(inToken)
// TODO: probably a better way to handle this.
if (token == null) {
if (!token) {
this.emit('error', 'Received null GSSAPI token on continue')
}
const buf = Buffer.from(token, 'base64')
Expand Down

0 comments on commit 6f37dda

Please sign in to comment.