const express = require('express');
const router = express.Router();
const authChecker = require('../../../libs/auth/checker');
const auth = require('../../../libs/auth');



router.get('/', authChecker.checkLogin, function (req, res, next) {
  (async function () {
    let ac = await auth.getAc(req);
    let menu = new auth.Menu(require('../../../libs/auth/menu-config'), ac);
    let menuList = menu.getByRole('user');
    res.json(menuList);
  })().catch(next)
});


module.exports = router;
