Skip to content

Commit c93902e

Browse files
Address PR comments
1 parent fdcf5d5 commit c93902e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/connection_string.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
AnyOptions,
2929
Callback,
3030
DEFAULT_PK_FACTORY,
31+
emitWarning,
3132
emitWarningOnce,
3233
HostAddress,
3334
isRecord,
@@ -640,19 +641,21 @@ export const OPTIONS = {
640641
'AWS_SESSION_TOKEN'
641642
];
642643

643-
const properties = Object.create(null);
644+
const mechanismProperties = Object.create(null);
644645

645646
for (const [key, _value] of entriesFromString(value)) {
646647
if (validKeys.includes(key)) {
647648
if (key === 'CANONICALIZE_HOST_NAME') {
648-
properties[key] = getBoolean(key, _value);
649+
mechanismProperties[key] = getBoolean(key, _value);
649650
} else {
650-
properties[key] = _value;
651+
mechanismProperties[key] = _value;
651652
}
652653
}
653654
}
654655

655-
value = properties;
656+
return MongoCredentials.merge(options.credentials, {
657+
mechanismProperties
658+
});
656659
}
657660
if (!isRecord(value)) {
658661
throw new MongoParseError('AuthMechanismProperties must be an object');

0 commit comments

Comments
 (0)