From 425f474af4391cfa782856dbc0ce7c68f532acd3 Mon Sep 17 00:00:00 2001 From: Vishnu Sankar Date: Thu, 4 Oct 2018 23:09:50 +0530 Subject: [PATCH] [@types/passport-auth0] : Updated StrategyOption to include "domain" variable (#29425) * - Added Auth0 `domain` property on StrategyOption * - Added required prop : StrategyOption.domain * - Fixed : typedef-whitespace error Ref : https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/436867585#L3525 * - Fixed : Added missing comma https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/436867585#L3528 * - Added contributor info --- types/passport-auth0/index.d.ts | 3 ++- types/passport-auth0/passport-auth0-tests.ts | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/types/passport-auth0/index.d.ts b/types/passport-auth0/index.d.ts index 5bcfced19c..fb71a215b4 100644 --- a/types/passport-auth0/index.d.ts +++ b/types/passport-auth0/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for passport-auth0 1.0 // Project: https://github.com/auth0/passport-auth0 // Definitions by: John Umeh +// Vishnu Sankar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -31,7 +32,7 @@ export interface StrategyOption { clientID: string; clientSecret: string; callbackURL: string; - + domain: string; scopeSeparator?: string; enableProof?: boolean; profileFields?: string[]; diff --git a/types/passport-auth0/passport-auth0-tests.ts b/types/passport-auth0/passport-auth0-tests.ts index 76e7ca85a0..5f3437106a 100644 --- a/types/passport-auth0/passport-auth0-tests.ts +++ b/types/passport-auth0/passport-auth0-tests.ts @@ -15,7 +15,8 @@ const User = { passport.use(new auth0.Strategy({ clientID: process.env.PASSPORT_AUTH0_CLIENT_ID as string, clientSecret: process.env.PASSPORT_AUTH0_CLIENT_SECRET as string, - callbackURL: process.env.PASSPORT_AUTH0_CALLBACK_URL as string + callbackURL: process.env.PASSPORT_AUTH0_CALLBACK_URL as string, + domain : process.env.PASSPORT_AUTH0_DOMAIN as string }, (accessToken: string, refreshToken: string, extraParams: auth0.ExtraVerificationParams, profile: auth0.Profile, done: (error: any, user?: any) => void) => { User.findOrCreate(profile.id, profile.provider, (err, user) => { @@ -29,6 +30,7 @@ passport.use(new auth0.Strategy({ clientID: process.env.PASSPORT_AUTH0_CLIENT_ID as string, clientSecret: process.env.PASSPORT_AUTH0_CLIENT_SECRET as string, callbackURL: process.env.PASSPORT_AUTH0_CALLBACK_URL as string, + domain : process.env.PASSPORT_AUTH0_DOMAIN as string, passReqToCallback: true }, (req: express.Request, accessToken: string, refreshToken: string, profile: auth0.Profile, done: (error: any, user?: any) => void) => { @@ -42,7 +44,8 @@ passport.use(new auth0.Strategy({ passport.use(new auth0.Strategy({ clientID: process.env.PASSPORT_AUTH0_CLIENT_ID as string, clientSecret: process.env.PASSPORT_AUTH0_CLIENT_SECRET as string, - callbackURL: process.env.PASSPORT_AUTH0_CALLBACK_URL as string + callbackURL: process.env.PASSPORT_AUTH0_CALLBACK_URL as string, + domain : process.env.PASSPORT_AUTH0_DOMAIN as string }, (accessToken: string, refreshToken: string, extraParams: auth0.ExtraVerificationParams, profile: auth0.Profile, done: (error: any, user?: any, info?: any) => void) => { done(null, false, { message: 'Some error.' });