Skip to content

Commit

Permalink
Merge pull request #642 from balena-io/fisehara/fix-implict-any-type
Browse files Browse the repository at this point in the history
Fisehara/fix implict any type
  • Loading branch information
Page- authored Feb 20, 2023
2 parents 3a4e163 + 8cfb757 commit 15751bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/passport-pinejs/passport-pinejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as permissions from '../sbvr-api/permissions';
export let login: (
fn: (
err: any,
user: {} | undefined,
user: {} | null | false | undefined,
req: Express.Request,
res: Express.Response,
next: Express.NextFunction,
Expand Down Expand Up @@ -54,15 +54,15 @@ const setup: ConfigLoader.SetupFunction = async (app: Express.Application) => {
passport.use(new LocalStrategy(checkPassword));

login = (fn) => (req, res, next) =>
passport.authenticate('local', (err, user?) => {
if (err || user == null) {
passport.authenticate('local', ((err, user) => {
if (err || user == null || user === false) {
fn(err, user, req, res, next);
return;
}
req.login(user, (error) => {
fn(error, user, req, res, next);
});
})(req, res, next);
}) as Passport.AuthenticateCallback)(req, res, next);

logout = (req, _res, next) => {
req.logout((error) => {
Expand Down

0 comments on commit 15751bd

Please sign in to comment.