aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-10-09 23:48:57 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-10-09 23:48:57 -0400
commitf46a8292fed43e3ef0b4b3607475b8862b42e562 (patch)
tree86ba3d8fc02aa08738a67daac668c893722b2972 /src/server/authentication
parent3f78566cc3fe6c45290c6156981e8623fa6ac11e (diff)
parent5617124a794b8d256e3d24b143b8dd2403cce993 (diff)
Merge branch 'masonry_stacking_interactions'
Diffstat (limited to 'src/server/authentication')
-rw-r--r--src/server/authentication/config/passport.ts10
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