[passport-facebook] Add missing optional param in verify callback (#13944)

This commit is contained in:
Lucas Martin Acosta
2017-01-12 08:46:30 -08:00
committed by Sheetal Nandi
parent 3a6791b20e
commit 99ddd7b2e6
2 changed files with 13 additions and 3 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
// Type definitions for passport-facebook 1.0.3
// Type definitions for passport-facebook 2.1.1
// Project: https://github.com/jaredhanson/passport-facebook
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>, Lucas Acosta <https://github.com/lucasmacosta>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="passport"/>
@@ -31,7 +31,7 @@ interface IStrategyOption {
declare class Strategy implements passport.Strategy {
constructor(options: IStrategyOption,
verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}
@@ -24,3 +24,13 @@ passport.use(new facebook.Strategy({
});
})
);
passport.use(new facebook.Strategy({
clientID: process.env.PASSPORT_FACEBOOK_CLIENT_ID,
clientSecret: process.env.PASSPORT_FACEBOOK_CLIENT_SECRET,
callbackURL: process.env.PASSPORT_FACEBOOK_CALLBACK_URL
},
function(accessToken:string, refreshToken:string, profile:facebook.Profile, done:(error:any, user?:any, info?:any) => void) {
done(null, false, { message: 'Some error.' });
})
);