mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[@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:
committed by
Wesley Wigham
parent
8d3d0fab16
commit
425f474af4
Vendored
+2
-1
@@ -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[];
|
||||
|
||||
@@ -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.' });
|
||||
|
||||
Reference in New Issue
Block a user