Skip to content

Commit c41b42b

Browse files
committed
chore: revert pool clear clearing cache
1 parent 0a0dd30 commit c41b42b

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/cmap/connection_pool.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
now,
4040
promiseWithResolvers
4141
} from '../utils';
42-
import type { MongoDBOIDC } from './auth/mongodb_oidc';
4342
import { connect } from './connect';
4443
import { Connection, type ConnectionEvents, type ConnectionOptions } from './connection';
4544
import {
@@ -429,19 +428,6 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
429428
return;
430429
}
431430

432-
// If we are clearing the connnection pool when using OIDC, we need to remove the access token
433-
// from the cache so we dont' try to use the same token again for initial auth on a new connection
434-
// when the token may have expired.
435-
const clientState = this.server.topology.client.s;
436-
const credentials = clientState.options.credentials;
437-
if (credentials?.mechanism === 'MONGODB-OIDC') {
438-
const provider = this.server.topology.client.s.authProviders.getOrCreateProvider(
439-
credentials.mechanism,
440-
credentials.mechanismProperties
441-
) as MongoDBOIDC;
442-
provider.workflow.cache.removeAccessToken();
443-
}
444-
445431
// handle load balanced case
446432
if (this.loadBalanced) {
447433
const { serviceId } = options;

0 commit comments

Comments
 (0)