Seperate method between passReqToCallback and normal way

This commit is contained in:
pathanin
2017-02-14 08:52:34 +07:00
parent ce3154548d
commit f618ed02a2
+23 -4
View File
@@ -31,12 +31,31 @@ interface IStrategyOption {
scopeSeparator?: string;
enableProof?: boolean;
profileFields?: string[];
passReqToCallback?: boolean;
}
interface IStrategyOptionWithRequest {
clientID: string;
clientSecret: string;
callbackURL: string;
scopeSeparator?: string;
enableProof?: boolean;
profileFields?: string[];
passReqToCallback: boolean;
}
interface VerifyFunction {
(accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void;
}
interface VerifyFunctionWithRequest {
(req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void;
}
declare class Strategy implements passport.Strategy {
constructor(options: IStrategyOption,
verify: (req?: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void);
name: string;
constructor(options: IStrategyOptionWithRequest, verify: VerifyFunctionWithRequest);
constructor(options: IStrategyOption, verify: VerifyFunction);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}