@@ -57,7 +57,6 @@ interface UserOIDCAuthState {
57
57
// A Promise that resolves when the current authentication attempt
58
58
// is finished, if there is one at the moment.
59
59
currentAuthAttempt : Promise < IdPServerResponse > | null ;
60
- currentAuthAttemptId : string | null ;
61
60
// The last set of OIDC tokens we have received together with a
62
61
// callback to refresh it and the client used to obtain it, if available.
63
62
currentTokenSet : {
@@ -247,7 +246,6 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
247
246
const state : UserOIDCAuthState = {
248
247
serverOIDCMetadata : { ...serializedState . serverOIDCMetadata } ,
249
248
currentAuthAttempt : null ,
250
- currentAuthAttemptId : null ,
251
249
currentTokenSet : null ,
252
250
lastIdTokenClaims : serializedState . lastIdTokenClaims
253
251
? { ...serializedState . lastIdTokenClaims }
@@ -285,7 +283,6 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
285
283
currentTokenSet : {
286
284
set : { ...state . currentTokenSet ?. set } ,
287
285
} ,
288
- currentAuthAttemptId : state . currentAuthAttemptId ,
289
286
lastIdTokenClaims : state . lastIdTokenClaims
290
287
? { ...state . lastIdTokenClaims }
291
288
: undefined ,
@@ -348,7 +345,6 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
348
345
const newState : UserOIDCAuthState = {
349
346
serverOIDCMetadata : serverMetadata ,
350
347
currentAuthAttempt : null ,
351
- currentAuthAttemptId : null ,
352
348
currentTokenSet : null ,
353
349
} ;
354
350
this . mapIdpToAuthState . set ( key , newState ) ;
@@ -1025,13 +1021,10 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
1025
1021
) ;
1026
1022
try {
1027
1023
state . currentAuthAttempt = newAuthAttempt ;
1028
- state . currentAuthAttemptId = `${ Date . now ( ) } ` ; // TODO req id typing.
1029
1024
return await newAuthAttempt ;
1030
1025
} finally {
1031
- if ( state . currentAuthAttempt === newAuthAttempt ) {
1026
+ if ( state . currentAuthAttempt === newAuthAttempt )
1032
1027
state . currentAuthAttempt = null ;
1033
- state . currentAuthAttemptId = null ;
1034
- }
1035
1028
}
1036
1029
} finally {
1037
1030
if ( params . refreshToken ) {
0 commit comments