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