mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
improve support of passReqToCallback option in passport Strategies for facebook, google-oauth2, local and twitter
This commit is contained in:
Vendored
+5
-12
@@ -11,9 +11,9 @@ import passport = require('passport');
|
||||
import express = require('express');
|
||||
|
||||
interface Profile extends passport.Profile {
|
||||
gender: string;
|
||||
profileUrl: string;
|
||||
username: string;
|
||||
gender?: string;
|
||||
profileUrl?: string;
|
||||
username?: string;
|
||||
|
||||
_raw: string;
|
||||
_json: any;
|
||||
@@ -33,15 +33,8 @@ interface IStrategyOption {
|
||||
profileFields?: string[];
|
||||
}
|
||||
|
||||
interface IStrategyOptionWithRequest {
|
||||
clientID: string;
|
||||
clientSecret: string;
|
||||
callbackURL: string;
|
||||
|
||||
scopeSeparator?: string;
|
||||
enableProof?: boolean;
|
||||
profileFields?: string[];
|
||||
passReqToCallback: boolean;
|
||||
interface IStrategyOptionWithRequest extends IStrategyOption {
|
||||
passReqToCallback: true;
|
||||
}
|
||||
|
||||
interface VerifyFunction {
|
||||
|
||||
+7
@@ -62,9 +62,16 @@ interface IOAuth2StrategyOption {
|
||||
openIDRealm?: string;
|
||||
}
|
||||
|
||||
interface IOAuth2StrategyOptionWithRequest extends IOAuth2StrategyOption {
|
||||
passReqToCallback: true;
|
||||
}
|
||||
|
||||
declare class OAuth2Strategy implements passport.Strategy {
|
||||
constructor(options: IOAuth2StrategyOption,
|
||||
verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
|
||||
constructor(options: IOAuth2StrategyOptionWithRequest,
|
||||
verify: (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
|
||||
|
||||
name: string;
|
||||
authenticate: (req: express.Request, options?: Object) => void;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -13,13 +13,13 @@ import express = require('express');
|
||||
interface IStrategyOptions {
|
||||
usernameField?: string;
|
||||
passwordField?: string;
|
||||
passReqToCallback?: boolean;
|
||||
passReqToCallback?: false;
|
||||
}
|
||||
|
||||
interface IStrategyOptionsWithRequest {
|
||||
usernameField?: string;
|
||||
passwordField?: string;
|
||||
passReqToCallback: boolean;
|
||||
passReqToCallback: true;
|
||||
}
|
||||
|
||||
interface IVerifyOptions {
|
||||
|
||||
Vendored
+7
-1
@@ -24,7 +24,6 @@ interface IStrategyOption {
|
||||
consumerSecret: string;
|
||||
callbackURL: string;
|
||||
|
||||
passReqToCallback?: true;
|
||||
includeEmail?: true;
|
||||
|
||||
reguestTokenURL?: string;
|
||||
@@ -36,9 +35,16 @@ interface IStrategyOption {
|
||||
skipExtendedUserProfile?: boolean;
|
||||
}
|
||||
|
||||
interface IStrategyOptionWithRequest extends IStrategyOption {
|
||||
passReqToCallback: true;
|
||||
}
|
||||
|
||||
declare class Strategy implements passport.Strategy {
|
||||
constructor(options: IStrategyOption,
|
||||
verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
|
||||
constructor(options: IStrategyOptionWithRequest,
|
||||
verify: (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void);
|
||||
|
||||
name: string;
|
||||
authenticate: (req: express.Request, options?: Object) => void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user