diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2019-12-03 15:32:57 -0500 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-12-03 15:32:57 -0500 |
| commit | 24f89a276005e25b1907f9236c5434f6c2e69746 (patch) | |
| tree | 151302ef29d4fa43b5822ab8512f5009492ff180 /src/server/authentication | |
| parent | 6b29c8177dae43f5d6a4ccdc2ca5dfc6f60e83eb (diff) | |
| parent | 9a0787aafb623ce0aa043419533b51378f56e070 (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/server/authentication')
| -rw-r--r-- | src/server/authentication/config/passport.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/authentication/config/passport.ts b/src/server/authentication/config/passport.ts index 2271109a5..0ced99b0d 100644 --- a/src/server/authentication/config/passport.ts +++ b/src/server/authentication/config/passport.ts @@ -40,7 +40,7 @@ export let isAuthenticated = (req: Request, res: Response, next: NextFunction) = export let isAuthorized = (req: Request, res: Response, next: NextFunction) => { const provider = req.path.split("/").slice(-1)[0]; - if (_.find(req.user?.tokens, { kind: provider })) { + if (_.find(req.user && "tokens" in req.user ? req.user["tokens"] : undefined, { kind: provider })) { next(); } else { res.redirect(`/auth/${provider}`); |
