Fix missing success and fail hooks

This commit is contained in:
David Ng
2017-08-25 17:57:46 +08:00
parent 93d659fc39
commit fb5eebb88b
2 changed files with 6 additions and 3 deletions
+2 -3
View File
@@ -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;
}
@@ -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;