Skip to content

Commit 9110a45

Browse files
fix: correctly assign username to X509 auth command (#2587)
A typo resulted in a provided username not being properly assigned to the command send to the server when using X509 authentication. NODE-2869
1 parent c9f9d5e commit 9110a45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/auth/x509.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class X509 extends AuthProvider {
2626
function x509AuthenticateCommand(credentials) {
2727
const command = { authenticate: 1, mechanism: 'MONGODB-X509' };
2828
if (credentials.username) {
29-
Object.apply(command, { user: credentials.username });
29+
Object.assign(command, { user: credentials.username });
3030
}
3131

3232
return command;

0 commit comments

Comments
 (0)