46 lines
1.4 KiB
Bash
46 lines
1.4 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
# Deploy universal auth snippet to ALL quiXzoom sites
|
||
|
|
|
||
|
|
SITES=(
|
||
|
|
"/home/bernt/.openclaw/workspace/quixzoom-landing-fixed"
|
||
|
|
"/home/bernt/.openclaw/workspace/quixzoom-asia-pages"
|
||
|
|
"/home/bernt/.openclaw/workspace/quixzoom-market-pages"
|
||
|
|
"/home/bernt/.openclaw/workspace/landvex-site/quixzoom"
|
||
|
|
)
|
||
|
|
|
||
|
|
SNIPPET_FILE="/home/bernt/.openclaw/workspace/quixzoom-sso-auth/universal-auth-snippet.html"
|
||
|
|
|
||
|
|
echo "🚀 Deploying universal auth to ALL quiXzoom sites..."
|
||
|
|
|
||
|
|
for site in "${SITES[@]}"; do
|
||
|
|
if [ -d "$site" ]; then
|
||
|
|
echo " 📁 Processing: $(basename "$site")"
|
||
|
|
|
||
|
|
find "$site" -name "*.html" -type f | while read -r htmlfile; do
|
||
|
|
# Skip if already has universal auth
|
||
|
|
if grep -q "qz-auth-bar" "$htmlfile" 2>/dev/null; then
|
||
|
|
# Remove old auth bar first
|
||
|
|
sed -i '/<div id="qz-auth-bar"/,/<\/script>/d' "$htmlfile"
|
||
|
|
echo " 🗑️ Removed old auth bar: $(basename "$htmlfile")"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Inject new universal auth before </body>
|
||
|
|
if grep -q "</body>" "$htmlfile"; then
|
||
|
|
# Create temp file with injection
|
||
|
|
sed -i '/<\/body>/e cat '"$SNIPPET_FILE"'' "$htmlfile"
|
||
|
|
echo " ✅ Injected: $(basename "$htmlfile")"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
echo ""
|
||
|
|
echo "✅ Universal auth deployed to all sites!"
|
||
|
|
echo ""
|
||
|
|
echo "Features:"
|
||
|
|
echo " • Silent login (auto-refresh tokens)"
|
||
|
|
echo " • Cross-domain cookie sync"
|
||
|
|
echo " • Real-time auth state"
|
||
|
|
echo " • Mobile app compatible"
|
||
|
|
echo ""
|