diff options
| author | laurawilsonri <laura_wilson@brown.edu> | 2019-04-11 14:12:49 -0400 |
|---|---|---|
| committer | laurawilsonri <laura_wilson@brown.edu> | 2019-04-11 14:12:49 -0400 |
| commit | c392a9322c1df269cfd823dd82d07d991fe065c0 (patch) | |
| tree | fdd44c511bd179984dc3dc18b92745751c86bfc5 /src/server/authentication/config/passport.ts | |
| parent | 15514b0f3d685764d1bd7ebeac9cdee1f778e184 (diff) | |
| parent | 50be8cb7a93110821c972c679567ddb6aae8bc6f (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into richTextEditor
Diffstat (limited to 'src/server/authentication/config/passport.ts')
| -rw-r--r-- | src/server/authentication/config/passport.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/authentication/config/passport.ts b/src/server/authentication/config/passport.ts index b6fe15655..d42741410 100644 --- a/src/server/authentication/config/passport.ts +++ b/src/server/authentication/config/passport.ts @@ -1,4 +1,4 @@ -import * as passport from 'passport' +import * as passport from 'passport'; import * as passportLocal from 'passport-local'; import * as mongodb from 'mongodb'; import * as _ from "lodash"; @@ -22,7 +22,7 @@ passport.deserializeUser<any, any>((id, done) => { passport.use(new LocalStrategy({ usernameField: 'email', passReqToCallback: true }, (req, email, password, done) => { User.findOne({ email: email.toLowerCase() }, (error: any, user: any) => { if (error) return done(error); - if (!user) return done(undefined, false, { message: "Invalid email or password" }) // invalid email + if (!user) return done(undefined, false, { message: "Invalid email or password" }); // invalid email user.comparePassword(password, (error: Error, isMatch: boolean) => { if (error) return done(error); if (!isMatch) return done(undefined, false, { message: "Invalid email or password" }); // invalid password @@ -37,7 +37,7 @@ export let isAuthenticated = (req: Request, res: Response, next: NextFunction) = return next(); } return res.redirect(RouteStore.login); -} +}; export let isAuthorized = (req: Request, res: Response, next: NextFunction) => { const provider = req.path.split("/").slice(-1)[0]; |
