diff --git a/AGENTS.md b/AGENTS.md index 2990f0c..ff68659 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,6 +37,35 @@ EuchreCamp is a Next.js 14+ application for managing Euchre tournaments and trac ## Common Tasks +### Admin User Creation + +To create an admin user, use the provided scripts: + +**Option 1: Using Better Auth API (Recommended)** +```bash +node scripts/create-admin-via-api.js +``` +This creates the admin user `david@dhg.lol` with password `adminadmin` using Better Auth's internal API. + +**Option 2: Direct Database Creation** +```bash +node scripts/create-admin-better-auth.js +``` +This creates the admin user `david@dhg.lol` with password `admin` directly in the database. + +**List All Users:** +```bash +node scripts/list-users.js +``` + +**Update Admin Password:** +```bash +node scripts/update-admin-password.js +``` +This updates the admin password to `adminadmin`. + +**Note:** All scripts currently create the user `david@dhg.lol`. If you need to create a different admin user, you can modify the email in the script or use Better Auth's CLI. + ### Fixing Authentication Issues If users are redirected incorrectly or permissions aren't working: 1. Check if cookie cache is disabled in `src/lib/auth.ts` diff --git a/README.md b/README.md index dcb917e..4303174 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,35 @@ npm run test npm run test:acceptance ``` +## Admin User Creation + +To create an admin user, use the provided scripts: + +**Option 1: Using Better Auth API (Recommended)** +```bash +node scripts/create-admin-via-api.js +``` +This creates the admin user `david@dhg.lol` with password `adminadmin` using Better Auth's internal API. + +**Option 2: Direct Database Creation** +```bash +node scripts/create-admin-better-auth.js +``` +This creates the admin user `david@dhg.lol` with password `admin` directly in the database. + +**List All Users:** +```bash +node scripts/list-users.js +``` + +**Update Admin Password:** +```bash +node scripts/update-admin-password.js +``` +This updates the admin password to `adminadmin`. + +**Note:** All scripts currently create the user `david@dhg.lol`. If you need to create a different admin user, you can modify the email in the script or use Better Auth's CLI. + ## User Stories User stories are organized into epics in `docs/USER_STORIES.md`: