Skip to content

Commit db5de6c

Browse files
author
Nighelles
committed
Fix backwards compatibility with authKey in javascript driver.
OTS by @danielmewes
1 parent b8bf3e1 commit db5de6c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net.coffee

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,12 @@ module.exports.connect = varar 0, 2, (hostOrCallback, callback) ->
16321632
# or in the browser.
16331633
# 2. Initializes the connection, and when it's complete invokes
16341634
# the user's callback
1635+
if host.authKey? && (host.password? || host.user?)
1636+
throw new err.ReqlDriverError "Cannot use both authKey and password"
1637+
else if host.authKey
1638+
host.user = "admin"
1639+
host.password = host.authKey
1640+
16351641
new Promise( (resolve, reject) ->
16361642
create_connection = (host, callback) =>
16371643
if TcpConnection.isAvailable()

0 commit comments

Comments
 (0)