← back to Designer Wallcoverings
DW-Agents/dw-agents/fix-all-auth-bypasses.sh
42 lines
#!/bin/bash
echo "🔒 Fixing ALL authentication bypasses in DW-Agents..."
echo ""
# Fix Legal Team - has "TEMPORARY: Skip authentication"
echo "📝 Fixing Legal Team agent..."
cat > /tmp/legal-fix.txt << 'EOF'
// Authentication middleware
const requireAuth = (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (req.session.authenticated) {
next();
} else {
res.redirect('/login');
}
};
EOF
sed -i '/Authentication middleware - DISABLED FOR DEBUGGING/,/^}/c\
// Authentication middleware\
const requireAuth = (req: express.Request, res: express.Response, next: express.NextFunction) => {\
if (req.session.authenticated) {\
next();\
} else {\
res.redirect('\''/login'\'');\
}\
};' /root/DW-Agents/agent-legal-team/legal-agent.ts
echo "✅ Legal Team fixed"
# Fix UI Manager - has "TEMPORARY: Disable auth for 4 hours"
echo "📝 Fixing UI Manager agent..."
sed -i '/TEMPORARY: Disable auth for 4 hours/,/return next();/d' /root/DW-Agents/agent-ui-manager/ui-manager-agent.ts
echo "✅ UI Manager fixed"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ All authentication bypasses removed!"
echo ""
echo "🔐 Restarting affected agents..."