From 08a9788bcc51d70309e39f7fc1336aac1e102409 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Mon, 1 Jun 2020 21:10:42 +0000 Subject: [PATCH] fix: fixed error with method bindings on strategies (#2971) - moved request bindings to after the cache handler Co-authored-by: Kim Gardner --- .../app/middleware/passport/strategies/oauth2.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/server/app/middleware/passport/strategies/oauth2.ts b/src/core/server/app/middleware/passport/strategies/oauth2.ts index 535d85c62..0131e014d 100644 --- a/src/core/server/app/middleware/passport/strategies/oauth2.ts +++ b/src/core/server/app/middleware/passport/strategies/oauth2.ts @@ -126,16 +126,16 @@ export default abstract class OAuth2Strategy< integration as Required ) as StrategyCreated; - // Augment the strategy with the request method bindings. - strategy.error = this.error.bind(this); - strategy.fail = this.fail.bind(this); - strategy.pass = this.pass.bind(this); - strategy.redirect = this.redirect.bind(this); - strategy.success = this.success.bind(this); - this.cache.set(tenant.id, strategy); } + // Augment the strategy with the request method bindings. + strategy.error = this.error.bind(this); + strategy.fail = this.fail.bind(this); + strategy.pass = this.pass.bind(this); + strategy.redirect = this.redirect.bind(this); + strategy.success = this.success.bind(this); + strategy.authenticate(req, { session: false, ...this.authenticateOptions,