Commit 8df33ca9cd08ac726fbb1a059690527548050fd2

Authored by Adhidarma Hadiwinoto
1 parent ee6fdd3631
Exists in master

config.sdk_supplier_product_quota.allow_non_super_terminal_login

Showing 1 changed file with 10 additions and 1 deletions Side-by-side Diff

lib/control-panel/index.js
... ... @@ -65,7 +65,16 @@ app.post('/login', express.urlencoded({ extended: false }), async (req, res) =>
65 65 const { username, password } = req.body;
66 66 const terminal = await coreTerminalAuth.validateWebPassword(username, password);
67 67  
68   - if (!terminal || !terminal.terminal_is_super || !terminal.store_is_super) {
  68 + if (!terminal || !terminal.store_is_super) {
  69 + res.redirect('/login');
  70 + return;
  71 + }
  72 +
  73 + if (
  74 + config.sdk_supplier_product_quota
  75 + && !config.sdk_supplier_product_quota.allow_non_super_terminal_login
  76 + && !terminal.terminal_is_super
  77 + ) {
69 78 res.redirect('/login');
70 79 return;
71 80 }