From 696e5f2e10f38a6cc9f7ecbe86345f7d12f2c45d Mon Sep 17 00:00:00 2001 From: Ankur Oberoi Date: Mon, 17 Sep 2018 00:41:54 -0700 Subject: [PATCH] [passport-oauth2] Allows callbackURL option to be omitted in constructor of OAuth2Strategy (#28907) * [passport-oauth2] callbackURL is an optional value The implementation for this OAuth2Strategy handles `callbackURL` being undefined, so this more accurately describes the interface. * Making at least one test case use no callbackURL --- types/passport-oauth2/index.d.ts | 2 +- types/passport-oauth2/passport-oauth2-tests.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/types/passport-oauth2/index.d.ts b/types/passport-oauth2/index.d.ts index 323d39853d..7d7f3de21d 100644 --- a/types/passport-oauth2/index.d.ts +++ b/types/passport-oauth2/index.d.ts @@ -45,7 +45,7 @@ declare namespace OAuth2Strategy { tokenURL: string; clientID: string; clientSecret: string; - callbackURL: string; + callbackURL?: string; } interface StrategyOptions extends _StrategyOptionsBase { passReqToCallback?: false; diff --git a/types/passport-oauth2/passport-oauth2-tests.ts b/types/passport-oauth2/passport-oauth2-tests.ts index 133bf5ec4e..6a5d09ef27 100644 --- a/types/passport-oauth2/passport-oauth2-tests.ts +++ b/types/passport-oauth2/passport-oauth2-tests.ts @@ -33,7 +33,6 @@ function verifyFunction4(_req: Request, _accessToken: string, _refreshToken: str const strategyOptions2: StrategyOptionsWithRequest = { authorizationURL: 'http://www.example.com/auth', - callbackURL: 'http://www.example.com/callback', clientID: 'dummy', clientSecret: 'secret', tokenURL: 'http://www.example.com/token',