mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2025-11-09 16:27:25 +00:00
Replace passport-local definition file with @types/passport-local
This commit: - use @types/passport-local - removes custom definition file - updates implementation to use correct interface from @types/passport-local Thanks!
This commit is contained in:
@@ -4,7 +4,7 @@ import * as nodemailer from "nodemailer";
|
||||
import * as passport from "passport";
|
||||
import { default as User, UserModel, AuthToken } from "../models/User";
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
import { LocalStrategyInfo } from "passport-local";
|
||||
import { IVerifyOptions } from "passport-local";
|
||||
import { WriteError } from "mongodb";
|
||||
const request = require("express-validator");
|
||||
|
||||
@@ -38,7 +38,7 @@ export let postLogin = (req: Request, res: Response, next: NextFunction) => {
|
||||
return res.redirect("/login");
|
||||
}
|
||||
|
||||
passport.authenticate("local", (err: Error, user: UserModel, info: LocalStrategyInfo) => {
|
||||
passport.authenticate("local", (err: Error, user: UserModel, info: IVerifyOptions) => {
|
||||
if (err) { return next(err); }
|
||||
if (!user) {
|
||||
req.flash("errors", info.message);
|
||||
|
||||
Reference in New Issue
Block a user