Monorepo for Aesthetic.Computer aesthetic.computer
at main 190 lines 4.4 kB view raw view rendered
1# ATProto User Creation Monitoring Guide 2 3## 🎯 Quick Start - Check Recent Signups 4 5```bash 6cd /workspaces/aesthetic-computer/at 7node scripts/audit-user-creation-sync.mjs aesthetic 10 8``` 9 10This will show you if new signups are: 11- ✅ Getting user codes 12- ✅ Creating MongoDB records 13- ✅ Creating ATProto accounts 14- ✅ Accessible on PDS 15 16--- 17 18## 📊 What You'll See 19 20### ✅ Healthy Signup 21``` 22👤 User: auth0|68ee500f0729405b6c0dfa18 23 Email: user@example.com 24 Email Verified: ✅ 25 ✅ Verifications record: count=1 26 ✅ Users record found: 27 Code: ac25nocoj 28 ATProto: 29 DID: did:plc:u6wlzqrokjtfzcra5lbbgh6i 30 Handle: user.at.aesthetic.computer 31 🔍 Checking PDS account... 32 ✅ PDS account exists and is accessible 33 ✅ ALL CHECKS PASSED 34``` 35 36### ⚠️ Problem Signup 37``` 38👤 User: auth0|123456789 39 Email: user@example.com 40 Email Verified: ✅ 41 ✅ Verifications record: count=1 42 ❌ No users record found 43 ⚠️ ISSUES FOUND: 44 - Missing users record 45``` 46 47--- 48 49## 🛠️ Available Tools 50 51### Permanent Monitoring Tools (`/at/scripts/`) 52 53**Primary Tool:** 54- `audit-user-creation-sync.mjs` ⭐ - Check user sync status 55 ```bash 56 node scripts/audit-user-creation-sync.mjs aesthetic 10 57 ``` 58 59**Supporting Tools:** 60- `check-auth0-webhook-config.mjs` - Verify Auth0 config 61- `query-auth0-signups.mjs` - Query Auth0 directly 62- `check-auth0-flow.mjs` - Check Auth0 flow 63- `check-recent-users.mjs` - Check recent users 64 65### One-Off Fix Tools (`/at/oldtools/`) 66 67Only use if problems arise: 68- `test-user-creation-flow.mjs` - Backfill missing records 69- `diagnose-user-code-generation.mjs` - Test code generation 70- `check-code-1-user.mjs` - Check index conflicts 71 72--- 73 74## 📅 Recommended Schedule 75 76### Weekly Health Check 77```bash 78# Check last 20 signups 79node scripts/audit-user-creation-sync.mjs aesthetic 20 80``` 81 82Expected: All checks passing, ATProto accounts created 83 84### After Deployment 85```bash 86# Verify config 87node scripts/check-auth0-webhook-config.mjs 88 89# Check recent signups 90node scripts/audit-user-creation-sync.mjs aesthetic 5 91``` 92 93### If Issues Detected 94```bash 95# Detailed audit 96node scripts/audit-user-creation-sync.mjs aesthetic 50 97 98# Check Netlify logs 99netlify functions:log auth0-events 100 101# If needed, run fix (from oldtools) 102node oldtools/test-user-creation-flow.mjs 10 --fix 103``` 104 105--- 106 107## 🔍 What to Look For 108 109### Good Signs ✅ 110- All users have verification records 111- Email-verified users have user codes 112- Email-verified users have ATProto accounts 113- PDS accounts are accessible 114- Zero issues reported 115 116### Warning Signs ⚠️ 117- Missing user records for verified users 118- Missing ATProto accounts for verified users 119- PDS login failures 120- Issues count > 0 121 122### Critical Issues 🚨 123- Multiple recent signups failing 124- No ATProto accounts being created 125- MongoDB connection errors 126- Auth0 webhook not firing 127 128--- 129 130## 📞 Troubleshooting Steps 131 1321. **Run audit** to identify scope of problem 133 ```bash 134 node scripts/audit-user-creation-sync.mjs aesthetic 20 135 ``` 136 1372. **Check Netlify function logs** 138 ```bash 139 netlify functions:log auth0-events 140 ``` 141 1423. **Verify webhook config** 143 ```bash 144 node scripts/check-auth0-webhook-config.mjs 145 ``` 146 1474. **Test user code generation** 148 ```bash 149 node oldtools/diagnose-user-code-generation.mjs 150 ``` 151 1525. **Manual fix if needed** 153 ```bash 154 node oldtools/test-user-creation-flow.mjs <user-sub> --fix 155 ``` 156 157--- 158 159## 📚 Documentation 160 161- `QUICK-REFERENCE.md` - Quick commands 162- `FIX-SUMMARY.md` - Oct 14, 2025 fix details 163- `INVESTIGATION-REPORT.md` - Full investigation 164- `TOOLS-README.md` - Complete tools documentation 165- `oldtools/README.md` - Archived tools info 166 167--- 168 169## 🎉 Current Status (as of Oct 14, 2025) 170 171- ✅ Index conflict fixed in `user-code.mjs` 172- ✅ All recent users backfilled (5 users) 173- ✅ Automated ATProto creation working 174- ✅ Monitoring tools in place 175 176**Next signup will automatically create ATProto account!** 177 178--- 179 180## 💡 Key Insights 181 1821. **Auth0 webhook IS working** - Verifications prove it 1832. **User codes follow format:** `ac{YY}{5-chars}` (e.g., `ac25nocoj`) 1843. **ATProto handles:** `{handle}.at.aesthetic.computer` or fallback to code 1854. **One check catches all:** audit script shows full pipeline 1865. **Fix once, monitor always:** Tools prevent future issues 187 188--- 189 190**For questions or issues, refer to full docs in `/at/` directory**