mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Added session property to strategy options
This commit is contained in:
Vendored
+19
-7
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user