mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add name property to the Strategy (#40100)
* Update index.d.ts * Update passport-jwt-tests.ts
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
4694b0c78f
commit
cde5554d55
1
types/passport-jwt/index.d.ts
vendored
1
types/passport-jwt/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user