diff --git a/types/passport-local/index.d.ts b/types/passport-local/index.d.ts index 4a87b132d8..70c3ecfdfc 100644 --- a/types/passport-local/index.d.ts +++ b/types/passport-local/index.d.ts @@ -7,7 +7,7 @@ -import passport = require('passport'); +import { Strategy as PassportStrategy } from 'passport-strategy'; import express = require('express'); interface IStrategyOptions { @@ -34,11 +34,10 @@ interface VerifyFunction { (username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends PassportStrategy { constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest); constructor(options: IStrategyOptions, verify: VerifyFunction); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: Object) => void; } diff --git a/types/passport-local/passport-local-tests.ts b/types/passport-local/passport-local-tests.ts index c177664103..a282cb53d3 100644 --- a/types/passport-local/passport-local-tests.ts +++ b/types/passport-local/passport-local-tests.ts @@ -12,6 +12,10 @@ interface IUser { username: string; } +const testingLocalStrategy = new local.Strategy(()=>{}); +testingLocalStrategy.success = () => {}; +testingLocalStrategy.fail = () => {}; + class User implements IUser { public username: string; public password: string;