diff options
| author | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-10-19 14:41:16 -0400 |
|---|---|---|
| committer | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-10-19 14:41:16 -0400 |
| commit | 1a8292f7588880718a657a5fca5c32f1a5975205 (patch) | |
| tree | 216639d9d5387ba2563b37b169c678301d671b15 /src/server/authentication/config/passport.ts | |
| parent | 5e04d7f94d180dc984e48eca888ac2cedfd0c7a3 (diff) | |
| parent | 3d910bae8771e67cabc1500c49b77d425fdf62e9 (diff) | |
merged
Diffstat (limited to 'src/server/authentication/config/passport.ts')
| -rw-r--r-- | src/server/authentication/config/passport.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/server/authentication/config/passport.ts b/src/server/authentication/config/passport.ts index 8b20d29b1..8915a4abf 100644 --- a/src/server/authentication/config/passport.ts +++ b/src/server/authentication/config/passport.ts @@ -41,11 +41,9 @@ 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 (req.user) { - if (_.find((req.user as any).tokens, { kind: provider })) { - next(); - } else { - res.redirect(`/auth/${provider}`); - } + if (_.find((req.user as any).tokens, { kind: provider })) { + next(); + } else { + res.redirect(`/auth/${provider}`); } };
\ No newline at end of file |
