Skip to content

Commit 7400c87

Browse files
committed
fix: use authProviders getOrCreateProvider
1 parent cc3053a commit 7400c87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmap/connection_pool.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,9 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
561561
}
562562

563563
const resolvedCredentials = credentials.resolveAuthMechanism(connection.hello);
564-
const provider = AUTH_PROVIDERS.get(resolvedCredentials.mechanism);
564+
const provider = this[kServer].topology.client.s.authProviders.getOrCreateProvider(
565+
resolvedCredentials.mechanism
566+
);
565567

566568
if (!provider) {
567569
throw new MongoMissingCredentialsError(

0 commit comments

Comments
 (0)