helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [12/14] helix git commit: Skip admin check if called authorize
Date Sat, 18 Aug 2018 00:20:12 GMT
http://git-wip-us.apache.org/repos/asf/helix/blob/f1c50371/helix-front/server/controllers/user.ts
----------------------------------------------------------------------
diff --git a/helix-front/server/controllers/user.ts b/helix-front/server/controllers/user.ts
index 1cd5288..21e1b0f 100644
--- a/helix-front/server/controllers/user.ts
+++ b/helix-front/server/controllers/user.ts
@@ -17,16 +17,14 @@ export class UserCtrl {
   // please rewrite this function to support your own authorization logic
   protected authorize(req: Request, res: Response) {
     if (req.query.name) {
+      // since it's bypass mode, skip admin check
       req.session.username = req.query.name;
-      CheckAdmin(req.session.username, (isAdmin: boolean) => {
-        req.session.isAdmin = isAdmin;
 
-        if (req.query.url) {
-          res.redirect(req.query.url);
-        } else {
-          res.redirect('/');
-        }
-      });
+      if (req.query.url) {
+        res.redirect(req.query.url);
+      } else {
+        res.redirect('/');
+      }
     } else {
       res.status(401).send('Unauthorized');
     }


Mime
View raw message