diff options
| author | Sam Wilkins <35748010+samwilkins333@users.noreply.github.com> | 2019-09-29 19:04:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-29 19:04:29 -0400 |
| commit | 89fd714207dbd965dc4b566202ec85bbd7998adf (patch) | |
| tree | 4b6279f1fe0157eb79fabd000a55754c33253506 /src/server/authentication/config/passport.ts | |
| parent | c40480ec1a2da84b4223b0605bea2fe19df1104c (diff) | |
| parent | 5bd6158a1f839d19f8965bff97a908c89271437d (diff) | |
Merge pull request #289 from browngraphicslab/googlephotos_sharing_master
Googlephotos sharing master
Diffstat (limited to 'src/server/authentication/config/passport.ts')
| -rw-r--r-- | src/server/authentication/config/passport.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/authentication/config/passport.ts b/src/server/authentication/config/passport.ts index 10b17de71..f69b274d3 100644 --- a/src/server/authentication/config/passport.ts +++ b/src/server/authentication/config/passport.ts @@ -1,7 +1,6 @@ import * as passport from 'passport'; import * as passportLocal from 'passport-local'; -import * as mongodb from 'mongodb'; -import * as _ from "lodash"; +import _ from "lodash"; import { default as User } from '../models/user_model'; import { Request, Response, NextFunction } from "express"; import { RouteStore } from '../../RouteStore'; @@ -43,7 +42,7 @@ export let isAuthorized = (req: Request, res: Response, next: NextFunction) => { const provider = req.path.split("/").slice(-1)[0]; if (req.user) { - if (_.find((req.user as any).tokens, { kind: provider })) { + if (_.find(req.user.tokens, { kind: provider })) { next(); } else { res.redirect(`/auth/${provider}`); |
