@moquyun/proxy
Version:
Multi-user & multi-env web debugging proxy based on whistle
15 lines (13 loc) • 327 B
JavaScript
const { checkLogin } = require('../../util/login');
module.exports = async (ctx, next) => {
const { username, password } = ctx.storage.getAdmin();
const accept = checkLogin(ctx, {
username,
password,
nameKey: 'nohost_admin_name',
authKey: 'nohost_admin_key',
});
if (accept) {
await next();
}
};