Add name property to the Strategy (#40100)

* Update index.d.ts

* Update passport-jwt-tests.ts
This commit is contained in:
BRAMILLE Sébastien
2019-11-08 23:51:02 +00:00
committed by Nathan Shively-Sanders
parent 4694b0c78f
commit cde5554d55
2 changed files with 2 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ import { VerifyOptions } from 'jsonwebtoken'
export declare class Strategy extends PassportStrategy {
constructor(opt: StrategyOptions, verify: VerifyCallback);
constructor(opt: StrategyOptions, verify: VerifyCallbackWithRequest);
name: string;
}
export interface StrategyOptions {

View File

@@ -13,7 +13,7 @@ let opts: StrategyOptions = {
audience: "example.org"
};
passport.use(new JwtStrategy(opts, function(jwt_payload, done) {
passport.use(JwtStrategy.name, new JwtStrategy(opts, function(jwt_payload, done) {
findUser({id: jwt_payload.sub}, function(err, user) {
if (err) {
return done(err, false);