diff --git a/oidc-consumer/src/index.ts b/oidc-consumer/src/index.ts index 01ce16f..18cae8b 100644 --- a/oidc-consumer/src/index.ts +++ b/oidc-consumer/src/index.ts @@ -262,7 +262,7 @@ class OidcConsumer { * @param retryOnFailure - Flag to throw error if found or recursively call itself * @throws SESSION_VERIFICATION_FAILED if session verification fails. */ - async verifySession(request: Request, response: Response, next: NextFunction, retryOnFailure: Boolean = true, sessionRetryDelayMS: number = this.timeout) { + async verifySession(request: Request, response: Response, next: NextFunction, retryOnFailure: Boolean = true, sessionRetryDelayMS: number = this.sessionRetryDelayMS) { await new Promise(resolve => { request.session.reload((err) => { if(err) { @@ -289,7 +289,7 @@ class OidcConsumer { console.log("error in retry") }); } - else if (!state && !retryOnFailure) { + else { return next(new Error("SESSION_VERIFICATION_FAILED")); } }; diff --git a/oidc-consumer/src/interfaces/index.ts b/oidc-consumer/src/interfaces/index.ts index 235bc46..37b9e72 100644 --- a/oidc-consumer/src/interfaces/index.ts +++ b/oidc-consumer/src/interfaces/index.ts @@ -2,7 +2,7 @@ import { Session, SessionData, SessionOptions } from "express-session"; import { ModuleOptions } from "simple-oauth2"; export interface IConsumerOptions { - timeout: number; + sessionRetryDelayMS: number; scope: string; callback_route?: string;