MCPcopy
hub / github.com/mongodb/node-mongodb-native / getCredentials

Function getCredentials

src/cmap/auth/mongodb_oidc.ts:179–185  ·  view source on GitHub ↗

* Get credentials from the auth context, throwing if they do not exist.

(authContext: AuthContext)

Source from the content-addressed store, hash-verified

177 * Get credentials from the auth context, throwing if they do not exist.
178 */
179function getCredentials(authContext: AuthContext): MongoCredentials {
180 const { credentials } = authContext;
181 if (!credentials) {
182 throw new MongoMissingCredentialsError(MISSING_CREDENTIALS_ERROR);
183 }
184 return credentials;
185}

Callers 2

authMethod · 0.85
prepareMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected