Monorepo for Aesthetic.Computer
aesthetic.computer
1#!/usr/bin/env node
2// check-auth0-webhook-config.mjs
3// Check if Auth0 Log Stream is properly configured and receiving events
4
5import { config } from 'dotenv';
6
7config();
8
9console.log('\n🔍 Checking Auth0 Log Stream Configuration\n');
10console.log('════════════════════════════════════════════════════════════════\n');
11
12// Check environment variables
13console.log('📋 Environment Variables:\n');
14console.log(`AUTH0_LOG_TOKEN: ${process.env.AUTH0_LOG_TOKEN ? '✅ Set' : '❌ Missing'}`);
15console.log(`AUTH0_M2M_CLIENT_ID: ${process.env.AUTH0_M2M_CLIENT_ID ? '✅ Set' : '❌ Missing'}`);
16console.log(`AUTH0_M2M_SECRET: ${process.env.AUTH0_M2M_SECRET ? '✅ Set' : '❌ Missing'}`);
17
18console.log('\n════════════════════════════════════════════════════════════════\n');
19console.log('📍 Expected Auth0 Log Stream Configuration:\n');
20console.log(' Dashboard: https://manage.auth0.com/dashboard/us/aesthetic/log-streams');
21console.log(' Endpoint: https://aesthetic.computer/.netlify/functions/auth0-events');
22console.log(' Authorization Header: Should match AUTH0_LOG_TOKEN');
23console.log(' Event Types to Stream:');
24console.log(' - ss (Success Signup)');
25console.log(' - sv (Success Verification Email)');
26
27console.log('\n════════════════════════════════════════════════════════════════\n');
28console.log('💡 Troubleshooting Steps:\n');
29console.log(' 1. Verify Log Stream is active in Auth0 dashboard');
30console.log(' 2. Check that webhook URL is correct');
31console.log(' 3. Verify AUTH0_LOG_TOKEN matches in both Auth0 and .env');
32console.log(' 4. Check Netlify function logs for incoming webhook calls');
33console.log(' 5. Test webhook manually with curl/Postman\n');
34
35console.log('🔗 To check Netlify function logs, run:');
36console.log(' netlify functions:log auth0-events\n');
37
38console.log('🔗 Or view in Netlify dashboard:');
39console.log(' https://app.netlify.com/sites/aesthetic-computer/logs/functions\n');