Files
euchre_camp/scripts/register-admin.sh
T
david 123df671f5 nextjs-rewrite (#5)
Reviewed-on: #5
Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
2026-03-30 02:30:13 +00:00

28 lines
599 B
Bash
Executable File

#!/bin/bash
# Start the dev server in background
echo "Starting dev server..."
npm run dev > /tmp/next-auth-test.log 2>&1 &
SERVER_PID=$!
# Wait for server to start
sleep 8
# Try to register via API
echo "Attempting to register admin user..."
curl -X POST http://localhost:3000/api/auth/sign-up/email \
-H "Content-Type: application/json" \
-d '{
"email": "david@dhg.lol",
"password": "admin",
"name": "David Admin"
}' \
2>/dev/null
echo ""
echo "Checking if user was created..."
sqlite3 prisma/dev.db "SELECT email, role FROM users;"
# Cleanup
kill $SERVER_PID 2>/dev/null