Skip to content

Commit c18a665

Browse files
committed
fixup: remove unrelated code
1 parent 44e53f9 commit c18a665

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/plugin.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ interface UserOIDCAuthState {
5757
// A Promise that resolves when the current authentication attempt
5858
// is finished, if there is one at the moment.
5959
currentAuthAttempt: Promise<IdPServerResponse> | null;
60-
currentAuthAttemptId: string | null;
6160
// The last set of OIDC tokens we have received together with a
6261
// callback to refresh it and the client used to obtain it, if available.
6362
currentTokenSet: {
@@ -247,7 +246,6 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
247246
const state: UserOIDCAuthState = {
248247
serverOIDCMetadata: { ...serializedState.serverOIDCMetadata },
249248
currentAuthAttempt: null,
250-
currentAuthAttemptId: null,
251249
currentTokenSet: null,
252250
lastIdTokenClaims: serializedState.lastIdTokenClaims
253251
? { ...serializedState.lastIdTokenClaims }
@@ -285,7 +283,6 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
285283
currentTokenSet: {
286284
set: { ...state.currentTokenSet?.set },
287285
},
288-
currentAuthAttemptId: state.currentAuthAttemptId,
289286
lastIdTokenClaims: state.lastIdTokenClaims
290287
? { ...state.lastIdTokenClaims }
291288
: undefined,
@@ -348,7 +345,6 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
348345
const newState: UserOIDCAuthState = {
349346
serverOIDCMetadata: serverMetadata,
350347
currentAuthAttempt: null,
351-
currentAuthAttemptId: null,
352348
currentTokenSet: null,
353349
};
354350
this.mapIdpToAuthState.set(key, newState);
@@ -1025,13 +1021,10 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
10251021
);
10261022
try {
10271023
state.currentAuthAttempt = newAuthAttempt;
1028-
state.currentAuthAttemptId = `${Date.now()}`; // TODO req id typing.
10291024
return await newAuthAttempt;
10301025
} finally {
1031-
if (state.currentAuthAttempt === newAuthAttempt) {
1026+
if (state.currentAuthAttempt === newAuthAttempt)
10321027
state.currentAuthAttempt = null;
1033-
state.currentAuthAttemptId = null;
1034-
}
10351028
}
10361029
} finally {
10371030
if (params.refreshToken) {

0 commit comments

Comments
 (0)