@types/passport-http: fix unused template param #1 (#35083)

* fix(passport-http): use unused template param

It looks like this was rigged up so the appropriate callback definition could be inferred, but one detail got missed.

* test(passport-http): add tests demonstrating passReqToCallback
This commit is contained in:
Ian Remmel
2019-05-06 11:22:27 -07:00
committed by Jesse Trinity
parent 980af53777
commit 64dcd8e53f
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import express = require("express");
export interface BasicStrategyOptions<req extends boolean = boolean> {
realm?: string;
passReqToCallback?: boolean;
passReqToCallback?: req;
}
export interface DigestStrategyOptions {
@@ -25,6 +25,9 @@ function validateNonce(nonce: string) {
function validateParams(nonce: string, cnonce: string, nc: number, opaque: string) {
}
new http.BasicStrategy({passReqToCallback: false}, (username, password, done) => {});
new http.BasicStrategy({passReqToCallback: true}, (req, username, password, done) => {});
passport.use(new http.BasicStrategy((username, password, done) => {
User.findOne({
username,