mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
add ExtractJwt.fromExtractors (#16684)
This commit is contained in:
1
types/passport-jwt/index.d.ts
vendored
1
types/passport-jwt/index.d.ts
vendored
@@ -43,4 +43,5 @@ export declare namespace ExtractJwt {
|
||||
export function fromUrlQueryParameter(param_name: string): JwtFromRequestFunction;
|
||||
export function fromAuthHeaderWithScheme(auth_scheme: string): JwtFromRequestFunction;
|
||||
export function fromAuthHeader(): JwtFromRequestFunction;
|
||||
export function fromExtractors(extractors: JwtFromRequestFunction[]): JwtFromRequestFunction;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ opts.jwtFromRequest = ExtractJwt.fromHeader('x-api-key');
|
||||
opts.jwtFromRequest = ExtractJwt.fromBodyField('field_name');
|
||||
opts.jwtFromRequest = ExtractJwt.fromUrlQueryParameter('param_name');
|
||||
opts.jwtFromRequest = ExtractJwt.fromAuthHeaderWithScheme('param_name');
|
||||
opts.jwtFromRequest = ExtractJwt.fromExtractors([ExtractJwt.fromHeader('x-api-key'), ExtractJwt.fromBodyField('field_name'), ExtractJwt.fromUrlQueryParameter('param_name')]);
|
||||
opts.jwtFromRequest = (req: Request) => { return req.query.token; };
|
||||
|
||||
declare function findUser(condition: {id: string}, callback: (error: any, user :any) => void): void;
|
||||
|
||||
Reference in New Issue
Block a user