Merge pull request #24599 from emzero/master

[@types/passport-local] Added session property to strategy options
This commit is contained in:
Paul van Brenk
2018-04-03 13:04:06 -07:00
committed by GitHub
+19 -7
View File
@@ -6,20 +6,20 @@
/// <reference types="passport"/>
import { Strategy as PassportStrategy } from 'passport-strategy';
import express = require('express');
import { Strategy as PassportStrategy } from "passport-strategy";
import express = require("express");
interface IStrategyOptions {
usernameField?: string;
passwordField?: string;
session?: boolean;
passReqToCallback?: false;
}
interface IStrategyOptionsWithRequest {
usernameField?: string;
passwordField?: string;
session?: boolean;
passReqToCallback: true;
}
@@ -28,15 +28,27 @@ interface IVerifyOptions {
}
interface VerifyFunctionWithRequest {
(req: express.Request, username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void;
(
req: express.Request,
username: string,
password: string,
done: (error: any, user?: any, options?: IVerifyOptions) => void
): void;
}
interface VerifyFunction {
(username: string, password: string, done: (error: any, user?: any, options?: IVerifyOptions) => void): void;
(
username: string,
password: string,
done: (error: any, user?: any, options?: IVerifyOptions) => void
): void;
}
declare class Strategy extends PassportStrategy {
constructor(options: IStrategyOptionsWithRequest, verify: VerifyFunctionWithRequest);
constructor(
options: IStrategyOptionsWithRequest,
verify: VerifyFunctionWithRequest
);
constructor(options: IStrategyOptions, verify: VerifyFunction);
constructor(verify: VerifyFunction);