File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/cmap/auth/mongodb_oidc Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -236,8 +236,15 @@ export class CallbackWorkflow implements Workflow {
236
236
// With no token in the cache we use the request callback.
237
237
result = await requestCallback ( serverInfo , context ) ;
238
238
}
239
- // Validate that the result returned by the callback is acceptable.
239
+ // Validate that the result returned by the callback is acceptable. If it is not
240
+ // we must clear the token result from the cache.
240
241
if ( isCallbackResultInvalid ( result ) ) {
242
+ this . cache . deleteEntry (
243
+ connection . address ,
244
+ credentials . username || '' ,
245
+ requestCallback ,
246
+ refreshCallback || null
247
+ ) ;
241
248
throw new MongoMissingCredentialsError (
242
249
'User provided OIDC callbacks must return a valid object with an accessToken.'
243
250
) ;
You can’t perform that action at this time.
0 commit comments