[@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
This commit is contained in:
Vishnu Sankar
2018-10-04 10:39:50 -07:00
committed by Wesley Wigham
parent 8d3d0fab16
commit 425f474af4
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for passport-auth0 1.0
// Project: https://github.com/auth0/passport-auth0
// Definitions by: John Umeh <https://github.com/johnbendi>
// Vishnu Sankar <https://github.com/iamvishnusankar>
// 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[];
+5 -2
View File
@@ -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.' });