Skip to content

Commit

Permalink
add comment why we check if conversation is done
Browse files Browse the repository at this point in the history
  • Loading branch information
chilagrow committed Oct 4, 2024
1 parent b485a0b commit 9eeb1eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wireclient/wireclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ func (c *Conn) Login(ctx context.Context, username, password, authDB string) err
return fmt.Errorf("wireclient.Conn.Login: %s failed (ok was %v)", cmd.Command(), ok)
}

// when `saslContinue` is called twice the SCRAM client conversation is
// completed before the second `saslContinue` request,
// ensure to move only the incomplete conversation forward
if !conv.Done() {
payload, err = conv.Step(string(res.Get("payload").(wirebson.Binary).B))
if err != nil {
Expand Down

0 comments on commit 9eeb1eb

Please sign in to comment.