Skip to content

Commit d906ace

Browse files
author
Jannis Pohlmann
committed
connections: Reject connections with a GQL_CONNECTION_ERROR
Previously, we'd send a GQL_ERROR back, which is not correct.
1 parent 7b46a12 commit d906ace

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

connections.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ func (conn *connection) readLoop() {
271271
if conn.config.Authenticate != nil {
272272
user, err := conn.config.Authenticate(data.AuthToken)
273273
if err != nil {
274-
conn.SendError(fmt.Errorf("Failed to authenticate user: %v", err))
274+
msg := operationMessageForType(gqlConnectionError)
275+
msg.Payload = fmt.Sprintf("Failed to authenticate user: %v", err)
276+
conn.outgoing <- msg
275277
} else {
276278
conn.user = user
277279
conn.outgoing <- operationMessageForType(gqlConnectionAck)

0 commit comments

Comments
 (0)