Added session property to strategy options

This commit is contained in:
emzeroit
2018-03-28 15:40:28 -03:00
parent bf51de3bc8
commit 6cbc3a5006
+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);